|
9 | 9 | workflow_dispatch: |
10 | 10 |
|
11 | 11 | 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 | +
|
12 | 38 | build: |
13 | 39 | name: Build binaries |
14 | 40 | runs-on: ubuntu-latest |
@@ -74,29 +100,3 @@ jobs: |
74 | 100 | files: release/**/* |
75 | 101 | env: |
76 | 102 | 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