mirror of
https://github.com/block/buzz.git
synced 2026-11-12 20:31:12 +00:00
ci(desktop): add signed macOS canary build (#2419)
Signed-off-by: npub1rf6fvdj6ut0c4kcmjv4p5mmgh89nj58n69uu3fz3cvk3jn500hqs7emz79 <1a7496365ae2df8adb1b932a1a6f68b9cb3950f3d179c8a451c32d194e8f7dc1@sprout-oss.stage.blox.sqprod.co> Co-authored-by: npub1rf6fvdj6ut0c4kcmjv4p5mmgh89nj58n69uu3fz3cvk3jn500hqs7emz79 <1a7496365ae2df8adb1b932a1a6f68b9cb3950f3d179c8a451c32d194e8f7dc1@sprout-oss.stage.blox.sqprod.co>
This commit is contained in:
@@ -53,6 +53,7 @@ fi
|
||||
grep -q 'verify-release-ref\.sh' "$repo_root/.github/workflows/release.yml"
|
||||
grep -q 'verify-release-ref\.sh' "$repo_root/.github/workflows/docker.yml"
|
||||
grep -q 'test-release-ref-contract\.sh' "$repo_root/.github/workflows/ci.yml"
|
||||
"$repo_root/scripts/test-signed-canary-contract.sh"
|
||||
auto_tag="$repo_root/.github/workflows/auto-tag-on-release-pr-merge.yml"
|
||||
grep -q 'actions/create-github-app-token@' "$auto_tag"
|
||||
grep -q 'client-id:.*vars\.BUZZ_RELEASE_TAGGER_CLIENT_ID' "$auto_tag"
|
||||
|
||||
40
scripts/test-signed-canary-contract.sh
Executable file
40
scripts/test-signed-canary-contract.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
repo_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
|
||||
workflow="$repo_root/.github/workflows/signed-macos-canary.yml"
|
||||
|
||||
grep -Fq 'workflow_dispatch:' "$workflow"
|
||||
# The literal GitHub expression is the contract we are checking.
|
||||
# shellcheck disable=SC2016
|
||||
grep -Fq 'SOURCE_REF: ${{ github.ref }}' "$workflow"
|
||||
grep -Fq '"refs/heads/main"' "$workflow"
|
||||
grep -Fq 'contents: read' "$workflow"
|
||||
grep -Fq 'id-token: write' "$workflow"
|
||||
grep -Fq 'block/apple-codesign-action@' "$workflow"
|
||||
grep -Fq 'actions/upload-artifact@' "$workflow"
|
||||
grep -Fq 'retention-days: 7' "$workflow"
|
||||
grep -Fq '"createUpdaterArtifacts": false' "$workflow"
|
||||
|
||||
if grep -Eq 'contents: write|gh release|buzz-desktop-latest|latest\.json|TAURI_SIGNING_PRIVATE_KEY|verify-release-ref\.sh|refs/tags/' "$workflow"; then
|
||||
echo "signed canary workflow gained a release or publishing capability" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
on_block=$(
|
||||
awk '
|
||||
/^on:$/ { in_on = 1; next }
|
||||
in_on && /^[^[:space:]#]/ { exit }
|
||||
in_on && NF && $0 !~ /^[[:space:]]*#/ {
|
||||
gsub(/[[:space:]]/, "")
|
||||
print
|
||||
}
|
||||
' "$workflow"
|
||||
)
|
||||
if [[ "$on_block" != "workflow_dispatch:" ]]; then
|
||||
echo "signed canary workflow must have workflow_dispatch as its only trigger" >&2
|
||||
printf 'found on block:\n%s\n' "$on_block" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "signed canary contract passed"
|
||||
Reference in New Issue
Block a user