nsarrazin HF staff commited on
Commit
0676b38
1 Parent(s): 6681691

Use proper semver for major minor & patch releases in CI/CD (#991)

Browse files
Files changed (1) hide show
  1. .github/workflows/build-image.yml +20 -4
.github/workflows/build-image.yml CHANGED
@@ -23,7 +23,13 @@ jobs:
23
 
24
  - name: Extract package version
25
  id: package-version
26
- run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
 
 
 
 
 
 
27
 
28
  - name: Docker metadata
29
  id: meta
@@ -32,7 +38,9 @@ jobs:
32
  images: |
33
  ghcr.io/huggingface/chat-ui-db
34
  tags: |
35
- type=raw,value=${{ steps.package-version.outputs.version }},enable={{github.event_name == 'release'}}
 
 
36
  type=raw,value=latest,enable={{is_default_branch}}
37
  type=sha,enable={{is_default_branch}}
38
 
@@ -69,7 +77,13 @@ jobs:
69
 
70
  - name: Extract package version
71
  id: package-version
72
- run: echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
 
 
 
 
 
 
73
 
74
  - name: Docker metadata
75
  id: meta
@@ -78,7 +92,9 @@ jobs:
78
  images: |
79
  ghcr.io/huggingface/chat-ui
80
  tags: |
81
- type=raw,value=${{ steps.package-version.outputs.version }},enable={{github.event_name == 'release'}}
 
 
82
  type=raw,value=latest,enable={{is_default_branch}}
83
  type=sha,enable={{is_default_branch}}
84
 
 
23
 
24
  - name: Extract package version
25
  id: package-version
26
+ run: |
27
+ VERSION=$(jq -r .version package.json)
28
+ echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
29
+ MAJOR=$(echo $VERSION | cut -d '.' -f1)
30
+ echo "MAJOR=$MAJOR" >> $GITHUB_OUTPUT
31
+ MINOR=$(echo $VERSION | cut -d '.' -f1).$(echo $VERSION | cut -d '.' -f2)
32
+ echo "MINOR=$MINOR" >> $GITHUB_OUTPUT
33
 
34
  - name: Docker metadata
35
  id: meta
 
38
  images: |
39
  ghcr.io/huggingface/chat-ui-db
40
  tags: |
41
+ type=raw,value=${{ steps.package-version.outputs.VERSION }},enable=${{github.event_name == 'release'}}
42
+ type=raw,value=${{ steps.package-version.outputs.MAJOR }},enable=${{github.event_name == 'release'}}
43
+ type=raw,value=${{ steps.package-version.outputs.MINOR }},enable=${{github.event_name == 'release'}}
44
  type=raw,value=latest,enable={{is_default_branch}}
45
  type=sha,enable={{is_default_branch}}
46
 
 
77
 
78
  - name: Extract package version
79
  id: package-version
80
+ run: |
81
+ VERSION=$(jq -r .version package.json)
82
+ echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
83
+ MAJOR=$(echo $VERSION | cut -d '.' -f1)
84
+ echo "MAJOR=$MAJOR" >> $GITHUB_OUTPUT
85
+ MINOR=$(echo $VERSION | cut -d '.' -f1).$(echo $VERSION | cut -d '.' -f2)
86
+ echo "MINOR=$MINOR" >> $GITHUB_OUTPUT
87
 
88
  - name: Docker metadata
89
  id: meta
 
92
  images: |
93
  ghcr.io/huggingface/chat-ui
94
  tags: |
95
+ type=raw,value=${{ steps.package-version.outputs.VERSION }},enable=${{github.event_name == 'release'}}
96
+ type=raw,value=${{ steps.package-version.outputs.MAJOR }},enable=${{github.event_name == 'release'}}
97
+ type=raw,value=${{ steps.package-version.outputs.MINOR }},enable=${{github.event_name == 'release'}}
98
  type=raw,value=latest,enable={{is_default_branch}}
99
  type=sha,enable={{is_default_branch}}
100