File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -185,14 +185,17 @@ jobs:
185185 VERSION=${{ needs.release-please.outputs.tag_name }}
186186 VERSION_NO_V=${VERSION#v}
187187
188- # Download checksums
189- curl -L -o darwin-x64.sha256 \
188+ # Download checksums. -f makes curl fail (non-zero) on a 404 instead of
189+ # writing an HTML error page into the .sha256 file — so when a core
190+ # target is missing under always(), this job hard-fails rather than
191+ # baking a corrupt checksum into the formula.
192+ curl -fLsS -o darwin-x64.sha256 \
190193 "https://github.com/${{ github.repository }}/releases/download/${VERSION}/csp-darwin-x64.sha256"
191- curl -L -o darwin-arm64.sha256 \
194+ curl -fLsS -o darwin-arm64.sha256 \
192195 "https://github.com/${{ github.repository }}/releases/download/${VERSION}/csp-darwin-arm64.sha256"
193- curl -L -o linux-x64.sha256 \
196+ curl -fLsS -o linux-x64.sha256 \
194197 "https://github.com/${{ github.repository }}/releases/download/${VERSION}/csp-linux-x64.sha256"
195- curl -L -o linux-arm64.sha256 \
198+ curl -fLsS -o linux-arm64.sha256 \
196199 "https://github.com/${{ github.repository }}/releases/download/${VERSION}/csp-linux-arm64.sha256"
197200
198201 # Extract checksums
Original file line number Diff line number Diff line change 8383 if : ${{ endsWith(matrix.target, '-musl') }}
8484 run : |
8585 ZIG_VERSION=0.13.0
86- curl -fsSL "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz" \
87- | tar -xJ -C "$RUNNER_TEMP"
86+ # Zig signs releases with minisign (not SHA checksums). Verify the
87+ # tarball against the official ziglang.org public key before extracting
88+ # and executing it, so a compromised mirror/MITM can't inject a binary.
89+ ZIG_PUBKEY="RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U"
90+ TARBALL="zig-linux-x86_64-${ZIG_VERSION}.tar.xz"
91+ sudo apt-get update && sudo apt-get install -y minisign
92+ curl -fsSLO "https://ziglang.org/download/${ZIG_VERSION}/${TARBALL}"
93+ curl -fsSLO "https://ziglang.org/download/${ZIG_VERSION}/${TARBALL}.minisig"
94+ minisign -Vm "${TARBALL}" -P "${ZIG_PUBKEY}"
95+ tar -xJf "${TARBALL}" -C "$RUNNER_TEMP"
8896 echo "$RUNNER_TEMP/zig-linux-x86_64-${ZIG_VERSION}" >> "$GITHUB_PATH"
8997 cargo install --locked cargo-zigbuild --version '^0.19'
9098
You can’t perform that action at this time.
0 commit comments