From f74e5905a55d4bb4d45d85c8689a1f589691029e Mon Sep 17 00:00:00 2001 From: Albert Steinhof Date: Thu, 3 Dec 2026 11:28:50 +0200 Subject: [PATCH] CI: Publish SHA256 checksums and build provenance with releases Generate SHA256SUMS.txt plus a .sha256 file per zip in the macOS job, include them in the CI artifacts and the job summary, attest build provenance for the release zips, and upload all checksum files to the GitHub release alongside the binaries. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WB1L24sLVsB1pbh1hUZh3i --- .github/workflows/build.yml | 60 +++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9acfe230278..6bf73fda0cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,8 @@ jobs: runs-on: macos-latest permissions: contents: write + id-token: write + attestations: write env: JOB_TYPE: BUILD HOMEBREW_NO_INSTALL_CLEANUP: 1 @@ -42,12 +44,45 @@ jobs: - run: ./build_duet.tool - run: ./build_oc.tool + - name: Generate SHA256 checksums + working-directory: Binaries + run: | + set -euo pipefail + shopt -s nullglob + zips=(*.zip) + if [ ${#zips[@]} -eq 0 ]; then + echo "::error::No zip files found in Binaries" + exit 1 + fi + rm -f SHA256SUMS.txt + for f in "${zips[@]}"; do + shasum -a 256 "$f" > "$f.sha256" + cat "$f.sha256" >> SHA256SUMS.txt + done + { + echo "### SHA256 checksums" + echo '```' + cat SHA256SUMS.txt + echo '```' + } >> "$GITHUB_STEP_SUMMARY" + cat SHA256SUMS.txt + - name: Upload to Artifacts uses: actions/upload-artifact@v6 with: name: macOS XCODE5 Artifacts - path: Binaries/*.zip - - name: Upload to Release + path: | + Binaries/*.zip + Binaries/*.sha256 + Binaries/SHA256SUMS.txt + + - name: Attest build provenance + if: github.event_name == 'release' + uses: actions/attest-build-provenance@v3 + with: + subject-checksums: Binaries/SHA256SUMS.txt + + - name: Upload zips to Release if: github.event_name == 'release' uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2.9.0 with: @@ -55,6 +90,27 @@ jobs: file: Binaries/*.zip tag: ${{ github.ref }} file_glob: true + overwrite: true + + - name: Upload checksums to Release + if: github.event_name == 'release' + uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2.9.0 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: Binaries/*.sha256 + tag: ${{ github.ref }} + file_glob: true + overwrite: true + + - name: Upload SHA256SUMS.txt to Release + if: github.event_name == 'release' + uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2.9.0 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: Binaries/SHA256SUMS.txt + asset_name: SHA256SUMS.txt + tag: ${{ github.ref }} + overwrite: true build-linux-clangpdb: name: Linux CLANGPDB