Skip to content

Commit ce57488

Browse files
authored
Merge pull request #13 from thand-io/new-release-flow-p6
fix use next tag rather than git tag
2 parents 528fd96 + a6305ff commit ce57488

1 file changed

Lines changed: 6 additions & 24 deletions

File tree

.github/workflows/test-and-build.yml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ jobs:
9999
build-multi-platform:
100100
runs-on: ubuntu-latest
101101
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
102+
needs: auto-tag
102103

103104
steps:
104105
- name: Checkout code
@@ -112,10 +113,10 @@ jobs:
112113
with:
113114
go-version: ${{ env.GO_VERSION }}
114115

115-
- name: Get version from tag
116+
- name: Get version from auto-tag
116117
id: version
117118
run: |
118-
VERSION=${GITHUB_REF#refs/tags/}
119+
VERSION="${{ needs.auto-tag.outputs.new-tag }}"
119120
echo "version=$VERSION" >> $GITHUB_OUTPUT
120121
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
121122
@@ -168,18 +169,18 @@ jobs:
168169
docker-release:
169170
runs-on: ubuntu-latest
170171
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
171-
needs: build-multi-platform
172+
needs: [auto-tag, build-multi-platform]
172173

173174
steps:
174175
- name: Checkout code
175176
uses: actions/checkout@v4
176177
with:
177178
fetch-depth: 1
178179

179-
- name: Get version from tag
180+
- name: Get version from auto-tag
180181
id: version
181182
run: |
182-
VERSION=${GITHUB_REF#refs/tags/}
183+
VERSION="${{ needs.auto-tag.outputs.new-tag }}"
183184
echo "version=$VERSION" >> $GITHUB_OUTPUT
184185
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
185186
@@ -207,7 +208,6 @@ jobs:
207208
tags: |
208209
type=raw,value=dev
209210
type=raw,value=${{ steps.version.outputs.version }}
210-
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
211211
212212
- name: Build and push Docker image (dev + latest + version tags)
213213
uses: docker/build-push-action@v5
@@ -223,21 +223,3 @@ jobs:
223223
COMMIT=${{ steps.version.outputs.commit }}
224224
cache-from: type=gha
225225
cache-to: type=gha,mode=max
226-
227-
release:
228-
needs: [build-multi-platform, docker-release]
229-
runs-on: ubuntu-latest
230-
if: startsWith(github.ref, 'refs/tags/v')
231-
232-
steps:
233-
- name: Get version from tag
234-
id: version
235-
run: |
236-
VERSION=${GITHUB_REF#refs/tags/}
237-
echo "version=$VERSION" >> $GITHUB_OUTPUT
238-
239-
- name: Download artifacts
240-
uses: actions/download-artifact@v4
241-
with:
242-
name: binaries-${{ steps.version.outputs.version }}
243-
path: dist/

0 commit comments

Comments
 (0)