Skip to content

Commit 396834a

Browse files
committed
Update release.yml to work with unified binaries #415
1 parent 3eb96a4 commit 396834a

1 file changed

Lines changed: 10 additions & 87 deletions

File tree

.github/workflows/release.yml

Lines changed: 10 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
tag:
7-
description: "Release tag (e.g. v1.2.3)"
7+
description: 'Release tag (e.g. v1.2.3)'
88
required: true
99
type: string
1010

@@ -72,7 +72,7 @@ jobs:
7272
VALUE=$(python .github/workflows/release/release.py is-latest "${{ inputs.tag }}")
7373
echo "value=$VALUE" >> $GITHUB_OUTPUT
7474
75-
# Builds the x64 and arm64 binaries for Linux, for all 3 crates, via the Docker builder
75+
# Builds the x64 and arm64 binaries for Linux via the Docker builder
7676
build-binaries-linux:
7777
needs: [resolve-tag]
7878
timeout-minutes: 60
@@ -250,10 +250,10 @@ jobs:
250250
run: |
251251
mkdir -p ./artifacts/bin/linux_amd64
252252
mkdir -p ./artifacts/bin/linux_arm64
253-
tar -xzf ./artifacts/commit-boost-${{ matrix.crate }}-${{ inputs.tag }}-linux_x86-64/commit-boost-${{ matrix.crate }}-${{ inputs.tag }}-linux_x86-64.tar.gz -C ./artifacts/bin
254-
mv ./artifacts/bin/commit-boost-${{ matrix.crate }} ./artifacts/bin/linux_amd64/commit-boost-${{ matrix.crate }}
255-
tar -xzf ./artifacts/commit-boost-${{ matrix.crate }}-${{ inputs.tag }}-linux_arm64/commit-boost-${{ matrix.crate }}-${{ inputs.tag }}-linux_arm64.tar.gz -C ./artifacts/bin
256-
mv ./artifacts/bin/commit-boost-${{ matrix.crate }} ./artifacts/bin/linux_arm64/commit-boost-${{ matrix.crate }}
253+
tar -xzf ./artifacts/commit-boost-${{ inputs.tag }}-linux_x86-64/commit-boost-${{ inputs.tag }}-linux_x86-64.tar.gz -C ./artifacts/bin
254+
mv ./artifacts/bin/commit-boost ./artifacts/bin/linux_amd64/commit-boost
255+
tar -xzf ./artifacts/commit-boost-${{ inputs.tag }}-linux_arm64/commit-boost-${{ inputs.tag }}-linux_arm64.tar.gz -C ./artifacts/bin
256+
mv ./artifacts/bin/commit-boost ./artifacts/bin/linux_arm64/commit-boost
257257
258258
- name: Set lowercase owner
259259
run: echo "OWNER=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
@@ -297,7 +297,7 @@ jobs:
297297
uses: actions/download-artifact@v4
298298
with:
299299
path: ./artifacts
300-
pattern: "commit-boost*"
300+
pattern: "commit-boost-*"
301301

302302
- name: Sign all binaries with Sigstore
303303
uses: sigstore/gh-action-sigstore-python@v3.0.0
@@ -310,7 +310,7 @@ jobs:
310310
name: signed-${{ inputs.tag }}
311311
path: ./artifacts/**/*.sigstore*
312312

313-
# Creates a release on GitHub with the binaries
313+
# Creates a draft release on GitHub with the binaries
314314
finalize-release:
315315
needs:
316316
- build-binaries-linux
@@ -327,13 +327,7 @@ jobs:
327327
uses: actions/download-artifact@v4
328328
with:
329329
path: ./artifacts
330-
pattern: "commit-boost*"
331-
332-
- name: Download signatures
333-
uses: actions/download-artifact@v4
334-
with:
335-
path: ./artifacts
336-
pattern: "signatures-${{ github.ref_name }}*"
330+
pattern: "commit-boost-*"
337331

338332
- name: Download signed artifacts
339333
uses: actions/download-artifact@v4
@@ -350,75 +344,4 @@ jobs:
350344
tag_name: ${{ inputs.tag }}
351345
name: ${{ inputs.tag }}
352346
env:
353-
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
354-
355-
# Fast-forwards stable (full release) or beta (RC) to the new tag.
356-
# Runs after all artifacts are built and the draft release is created,
357-
# so stable/beta are never touched if any part of the pipeline fails.
358-
fast-forward-branch:
359-
needs:
360-
- finalize-release
361-
runs-on: ubuntu-latest
362-
steps:
363-
- uses: actions/create-github-app-token@v1
364-
id: app-token
365-
with:
366-
app-id: ${{ secrets.APP_ID }}
367-
private-key: ${{ secrets.APP_PRIVATE_KEY }}
368-
369-
- uses: actions/checkout@v4
370-
with:
371-
fetch-depth: 0
372-
token: ${{ steps.app-token.outputs.token }}
373-
374-
- name: Configure git
375-
run: |
376-
git config user.name "commit-boost-release-bot[bot]"
377-
git config user.email "commit-boost-release-bot[bot]@users.noreply.github.com"
378-
379-
- name: Fast-forward beta branch (RC releases)
380-
if: contains(github.ref_name, '-rc')
381-
run: |
382-
git checkout beta
383-
git merge --ff-only "${{ github.ref_name }}"
384-
git push origin beta
385-
386-
- name: Fast-forward stable branch (full releases)
387-
if: "!contains(github.ref_name, '-rc')"
388-
run: |
389-
git checkout stable
390-
git merge --ff-only "${{ github.ref_name }}"
391-
git push origin stable
392-
393-
# Deletes the tag if any job in the release pipeline fails.
394-
# This keeps the tag and release artifacts in sync — a tag should only
395-
# exist if the full pipeline completed successfully.
396-
# stable/beta are never touched on failure since fast-forward-branch
397-
# only runs after finalize-release succeeds.
398-
#
399-
# Note: if finalize-release specifically fails, a draft release may already
400-
# exist on GitHub pointing at the now-deleted tag and will need manual cleanup.
401-
cleanup-on-failure:
402-
needs:
403-
- build-binaries-linux
404-
- build-binaries-darwin
405-
- sign-binaries
406-
- build-and-push-pbs-docker
407-
- build-and-push-signer-docker
408-
- finalize-release
409-
- fast-forward-branch
410-
runs-on: ubuntu-latest
411-
if: failure()
412-
steps:
413-
- uses: actions/create-github-app-token@v1
414-
id: app-token
415-
with:
416-
app-id: ${{ secrets.APP_ID }}
417-
private-key: ${{ secrets.APP_PRIVATE_KEY }}
418-
419-
- uses: actions/checkout@v4
420-
with:
421-
token: ${{ steps.app-token.outputs.token }}
422-
423-
- name: Delete tag
424-
run: git push origin --delete ${{ github.ref_name }}
347+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)