1+
12name : Draft Release
23
34on :
@@ -83,20 +84,14 @@ jobs:
8384 - amd64
8485 - arm64
8586 name :
86- - commit-boost-cli
87- - commit-boost-pbs
88- - commit-boost-signer
87+ - commit-boost
8988 include :
9089 - target : amd64
9190 package-suffix : x86-64
9291 - target : arm64
9392 package-suffix : arm64
94- - name : commit-boost-cli
95- target-crate : cli
96- - name : commit-boost-pbs
97- target-crate : pbs
98- - name : commit-boost-signer
99- target-crate : signer
93+ - name : commit-boost
94+ target-crate : commit-boost
10095 runs-on : ubuntu-latest
10196 steps :
10297 - name : Checkout code
@@ -150,7 +145,7 @@ jobs:
150145 path : |
151146 ${{ matrix.name }}-${{ inputs.tag }}-linux_${{ matrix.package-suffix }}.tar.gz
152147
153- # Builds the arm64 binaries for Darwin, for all 3 crates, natively
148+ # Builds the arm64 binary for Darwin natively
154149 build-binaries-darwin :
155150 needs : [resolve-tag]
156151 timeout-minutes : 60
@@ -162,9 +157,7 @@ jobs:
162157 # - x86_64-apple-darwin
163158 - aarch64-apple-darwin
164159 name :
165- - commit-boost-cli
166- - commit-boost-pbs
167- - commit-boost-signer
160+ - commit-boost
168161 include :
169162 # - target: x86_64-apple-darwin
170163 # os: macos-latest-large
@@ -252,7 +245,7 @@ jobs:
252245 uses : actions/download-artifact@v4
253246 with :
254247 path : ./artifacts
255- pattern : " commit-boost- *"
248+ pattern : " commit-boost*"
256249
257250 - name : Extract binaries
258251 run : |
@@ -305,7 +298,7 @@ jobs:
305298 uses : actions/download-artifact@v4
306299 with :
307300 path : ./artifacts
308- pattern : " commit-boost- *"
301+ pattern : " commit-boost*"
309302
310303 - name : Sign all binaries with Sigstore
311304 uses : sigstore/gh-action-sigstore-python@v3.0.0
@@ -318,7 +311,7 @@ jobs:
318311 name : signed-${{ inputs.tag }}
319312 path : ./artifacts/**/*.sigstore*
320313
321- # Creates a draft release on GitHub with the binaries
314+ # Creates a release on GitHub with the binaries
322315 finalize-release :
323316 needs :
324317 - build-binaries-linux
@@ -335,7 +328,13 @@ jobs:
335328 uses : actions/download-artifact@v4
336329 with :
337330 path : ./artifacts
338- pattern : " commit-boost-*"
331+ pattern : " commit-boost*"
332+
333+ - name : Download signatures
334+ uses : actions/download-artifact@v4
335+ with :
336+ path : ./artifacts
337+ pattern : " signatures-${{ github.ref_name }}*"
339338
340339 - name : Download signed artifacts
341340 uses : actions/download-artifact@v4
@@ -352,4 +351,75 @@ jobs:
352351 tag_name : ${{ inputs.tag }}
353352 name : ${{ inputs.tag }}
354353 env :
355- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
354+ GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
355+
356+ # Fast-forwards stable (full release) or beta (RC) to the new tag.
357+ # Runs after all artifacts are built and the draft release is created,
358+ # so stable/beta are never touched if any part of the pipeline fails.
359+ fast-forward-branch :
360+ needs :
361+ - finalize-release
362+ runs-on : ubuntu-latest
363+ steps :
364+ - uses : actions/create-github-app-token@v1
365+ id : app-token
366+ with :
367+ app-id : ${{ secrets.APP_ID }}
368+ private-key : ${{ secrets.APP_PRIVATE_KEY }}
369+
370+ - uses : actions/checkout@v4
371+ with :
372+ fetch-depth : 0
373+ token : ${{ steps.app-token.outputs.token }}
374+
375+ - name : Configure git
376+ run : |
377+ git config user.name "commit-boost-release-bot[bot]"
378+ git config user.email "commit-boost-release-bot[bot]@users.noreply.github.com"
379+
380+ - name : Fast-forward beta branch (RC releases)
381+ if : contains(github.ref_name, '-rc')
382+ run : |
383+ git checkout beta
384+ git merge --ff-only "${{ github.ref_name }}"
385+ git push origin beta
386+
387+ - name : Fast-forward stable branch (full releases)
388+ if : " !contains(github.ref_name, '-rc')"
389+ run : |
390+ git checkout stable
391+ git merge --ff-only "${{ github.ref_name }}"
392+ git push origin stable
393+
394+ # Deletes the tag if any job in the release pipeline fails.
395+ # This keeps the tag and release artifacts in sync — a tag should only
396+ # exist if the full pipeline completed successfully.
397+ # stable/beta are never touched on failure since fast-forward-branch
398+ # only runs after finalize-release succeeds.
399+ #
400+ # Note: if finalize-release specifically fails, a draft release may already
401+ # exist on GitHub pointing at the now-deleted tag and will need manual cleanup.
402+ cleanup-on-failure :
403+ needs :
404+ - build-binaries-linux
405+ - build-binaries-darwin
406+ - sign-binaries
407+ - build-and-push-pbs-docker
408+ - build-and-push-signer-docker
409+ - finalize-release
410+ - fast-forward-branch
411+ runs-on : ubuntu-latest
412+ if : failure()
413+ steps :
414+ - uses : actions/create-github-app-token@v1
415+ id : app-token
416+ with :
417+ app-id : ${{ secrets.APP_ID }}
418+ private-key : ${{ secrets.APP_PRIVATE_KEY }}
419+
420+ - uses : actions/checkout@v4
421+ with :
422+ token : ${{ steps.app-token.outputs.token }}
423+
424+ - name : Delete tag
425+ run : git push origin --delete ${{ github.ref_name }}
0 commit comments