Skip to content

Commit b623788

Browse files
committed
Port workflow updates
This includes two mechanisms that should impair any theoretical ability on my part to modify a GitHub release without detection: 1. Printing the SHA256SUMS as they're generated, so you can see them in the workflow output and compare them with the release attachment. 2. Using GitHub's formal "Attestations" feature to sign the release archives with a Microsoft-controlled PKI that _should_ only be accessible in the context of a GitHub Actions workflow. There's a lot I don't love about this solution on principle, but it's cheap enough to add and arguably stronger since the attestations are stored in a public immutable log. More interestingly, if you do use the GitHub CLI to verify a tarball, it can link you to the specific workflow run that signed it without you having to dig through multiple levels of links. I wondered if I should bother to GPG-sign the SHA256SUMS file, but that wouldn't provide the guarantee I mentioned above, since I control that key and could theoretically modify the signature along with anything else.
1 parent 89cd109 commit b623788

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.github/workflows/build-release-archives.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,14 @@ jobs:
6565
path: target.tar.gz
6666

6767
assemble-archives:
68-
needs: [build-doc, build-binaries-unix]
68+
needs:
69+
- build-doc
70+
- build-binaries-unix
6971
runs-on: ubuntu-24.04
7072
permissions:
7173
contents: write
74+
id-token: write
75+
attestations: write
7276
steps:
7377
- name: Checkout
7478
uses: actions/checkout@v4
@@ -80,11 +84,15 @@ jobs:
8084
tar -xvf $targetdir/target.tar.gz
8185
make dist/xt-${targetdir#./target-}.tar.gz
8286
done
83-
(cd dist && sha256sum xt-*.tar.gz > SHA256SUMS)
87+
(cd dist && sha256sum xt-*.tar.gz | tee SHA256SUMS)
8488
- name: Upload Release Artifacts
8589
uses: actions/upload-artifact@v4
8690
with:
8791
name: release
8892
path: |
8993
dist/xt-*.tar.gz
9094
dist/SHA256SUMS
95+
- name: Create GitHub Attestation
96+
uses: actions/attest-build-provenance@v2
97+
with:
98+
subject-checksums: dist/SHA256SUMS

.github/workflows/release-process.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ jobs:
5757
uses: ./.github/workflows/build-release-archives.yml
5858
permissions:
5959
contents: write
60+
id-token: write
61+
attestations: write
6062

6163
merge-release:
6264
needs:
@@ -96,16 +98,16 @@ jobs:
9698
# outside of the GitHub workflow.
9799
#
98100
# THIS STEP IS THE POINT OF NO RETURN.
99-
# IT IS THE ATOMIC MOMENT AT WHICH THE RELEASE OCCURS AND CANNOT BE REVOKED.
101+
# IT IS THE ATOMIC MOMENT AT WHICH THE RELEASE OCCURS,
102+
# AFTER WHICH IT CANNOT BE REVOKED.
100103
#
101104
# Any failures after this point MUST be possible to recover from manually.
102105
# For example, the GitHub release can be cut by hand using archives uploaded
103106
# to the workflow run, and the crate can be published from a local checkout
104107
# of the tag.
105108
- name: Push Release
106109
if: ${{ github.ref == 'refs/heads/start-release' }}
107-
run: |
108-
git push --atomic origin main "$RELEASE_TAG" :"$RELEASE_BRANCH"
110+
run: git push --atomic origin main "$RELEASE_TAG" :"$RELEASE_BRANCH"
109111

110112
create-github-release:
111113
if: ${{ github.ref == 'refs/heads/start-release' }}

0 commit comments

Comments
 (0)