Skip to content

Commit 01d7527

Browse files
committed
ci: fix order
1 parent df3c8e5 commit 01d7527

1 file changed

Lines changed: 26 additions & 26 deletions

File tree

.github/workflows/release.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,32 @@ on:
99
workflow_dispatch:
1010

1111
jobs:
12+
retag:
13+
name: Update latest tag
14+
needs: release
15+
runs-on: ubuntu-latest
16+
if: startsWith(github.ref, 'refs/tags/')
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- name: Configure git user
23+
run: |
24+
git config user.name "github-actions[bot]"
25+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
26+
- name: Move latest tag
27+
env:
28+
COMMIT_SHA: ${{ github.sha }}
29+
run: |
30+
set -euo pipefail
31+
if git rev-parse latest >/dev/null 2>&1; then
32+
git tag -d latest
33+
fi
34+
git push origin :refs/tags/latest || true
35+
git tag latest "$COMMIT_SHA"
36+
git push origin latest --force
37+
1238
build:
1339
name: Build binaries
1440
runs-on: ubuntu-latest
@@ -74,29 +100,3 @@ jobs:
74100
files: release/**/*
75101
env:
76102
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77-
78-
retag:
79-
name: Update latest tag
80-
needs: release
81-
runs-on: ubuntu-latest
82-
if: startsWith(github.ref, 'refs/tags/')
83-
steps:
84-
- name: Checkout
85-
uses: actions/checkout@v4
86-
with:
87-
fetch-depth: 0
88-
- name: Configure git user
89-
run: |
90-
git config user.name "github-actions[bot]"
91-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
92-
- name: Move latest tag
93-
env:
94-
COMMIT_SHA: ${{ github.sha }}
95-
run: |
96-
set -euo pipefail
97-
if git rev-parse latest >/dev/null 2>&1; then
98-
git tag -d latest
99-
fi
100-
git push origin :refs/tags/latest || true
101-
git tag latest "$COMMIT_SHA"
102-
git push origin latest --force

0 commit comments

Comments
 (0)