mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-22 21:23:02 +01:00
Build jobs (Linux, Windows x64/ARM64, macOS, Windows installers, AUR and Homebrew staging) run repository code with no environment, secret, or id-token and produce unsigned files. Sign and publish jobs run in the release environment, check out only .github/release/, and run only those scripts and SHA-pinned actions on artifacts treated as data: macOS Developer ID signing, notarization, and stapling (from APPLE_SIGNING_CERTIFICATE, APPLE_NOTARY_KEY, and the APPLE_NOTARY_KEY_ID/ISSUER_ID variables), Azure Authenticode, the release service, the GitHub release, and the AUR and Homebrew pushes. Every artifact carries a SHA256SUMS whose digest its job reports; every job that downloads it checks that digest. Signed macOS builds are verified and launched in a job without secrets. macos-signed.yml is gone (a check run covers it); the site deploy is no longer part of Release.
14 lines
638 B
Shell
Executable file
14 lines
638 B
Shell
Executable file
#!/usr/bin/env bash
|
|
# write-checksums.sh <dir>: writes <dir>/SHA256SUMS for every file under <dir>
|
|
# and prints that manifest's digest. Every release artifact carries this
|
|
# manifest, and the job that made it reports the digest as a job output; the
|
|
# jobs that use the artifact check both (verify-artifacts.sh).
|
|
. "$(dirname "$0")/lib.sh"
|
|
|
|
cd "$(posix "$1")"
|
|
manifest=$(mktemp)
|
|
find . -type f ! -name SHA256SUMS | sed 's|^\./||' | LC_ALL=C sort | while IFS= read -r file; do sha256 "$file"; done > "$manifest"
|
|
[ -s "$manifest" ] || die "Nothing to upload in $1"
|
|
mv "$manifest" SHA256SUMS
|
|
cat SHA256SUMS >&2
|
|
sha256 SHA256SUMS | cut -c1-64
|