@@ -17,12 +17,14 @@ concurrency:
1717 group : ${{ github.workflow }}-${{ github.ref }}
1818 cancel-in-progress : true
1919
20+ # Least-privilege default: every job gets read-only contents unless it
21+ # specifically needs more (granted at the job level below). None of these
22+ # jobs comment on or annotate PRs via the GitHub API, so pull-requests/checks
23+ # write were unused broad grants — only the `security` job's SARIF upload
24+ # needs security-events:write (+ actions:read, required for private repos
25+ # per github/codeql-action/upload-sarif's docs; niac hit this exact gap).
2026permissions :
21- actions : read
2227 contents : read
23- pull-requests : write
24- checks : write
25- security-events : write
2628
2729jobs :
2830 # ============================================================================
@@ -441,6 +443,10 @@ jobs:
441443 name : Security Scanning
442444 runs-on : ubuntu-latest
443445 # Always runs — security checks are non-negotiable on every PR.
446+ permissions :
447+ contents : read
448+ security-events : write # upload-sarif (gosec + Trivy)
449+ actions : read # required alongside security-events:write on private repos
444450
445451 steps :
446452 - uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
@@ -639,6 +645,14 @@ jobs:
639645 # isn't bound until after the strategy expands). All matrix rows run
640646 # on every PR; per-arch arches are fast enough that the savings weren't
641647 # worth a workaround.
648+ #
649+ # macOS runners are 10x the minute multiplier of ubuntu-latest and are
650+ # NOT built here on PRs — darwin/amd64 (Intel) is dropped fleet-wide,
651+ # and darwin/arm64's real release binary is produced by goreleaser in
652+ # release.yml (unchanged). Since stem is CGO_ENABLED=0 (pure Go), the
653+ # darwin/arm64 build cross-compiles trivially on ubuntu; the dedicated
654+ # darwin-compile-check job below verifies it still compiles without
655+ # paying for a macOS runner on every PR.
642656 if : |
643657 always() &&
644658 needs.frontend.result == 'success' &&
@@ -659,18 +673,6 @@ jobs:
659673 goos : linux
660674 goarch : arm64
661675 required : false
662- - os : darwin
663- arch : amd64
664- runner : macos-latest
665- goos : darwin
666- goarch : amd64
667- required : false
668- - os : darwin
669- arch : arm64
670- runner : macos-latest
671- goos : darwin
672- goarch : arm64
673- required : false
674676 steps :
675677 - uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
676678
@@ -747,6 +749,44 @@ jobs:
747749 path : bin/stem-${{ matrix.os }}-${{ matrix.arch }}
748750 retention-days : 7
749751
752+ # ============================================================================
753+ # Darwin compile check — verifies the release target still cross-compiles
754+ # ============================================================================
755+ # macOS runners cost 10x the ubuntu-latest minute multiplier, so darwin
756+ # binaries are no longer built on PRs at all (see the `build` job comment
757+ # above). stem is CGO_ENABLED=0 (pure Go), so GOOS=darwin GOARCH=arm64
758+ # cross-compiles cleanly on ubuntu-latest — this job is a cheap compile-only
759+ # smoke check that the darwin/arm64 target hasn't broken, without paying for
760+ # a macOS runner. The actual signed darwin/arm64 release binary is still
761+ # produced by goreleaser in release.yml, unchanged. darwin/amd64 (Intel) is
762+ # dropped fleet-wide and is not checked here.
763+ darwin-compile-check :
764+ name : Darwin compile check (arm64)
765+ runs-on : ubuntu-latest
766+ needs : [changes, backend, frontend]
767+ if : |
768+ always() &&
769+ needs.frontend.result == 'success' &&
770+ (needs.backend.result == 'success' || needs.backend.result == 'skipped')
771+ steps :
772+ - uses : actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
773+
774+ - name : Set up Go
775+ uses : ./.github/actions/setup-go
776+
777+ - name : Download frontend build
778+ uses : actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
779+ with :
780+ name : frontend-dist
781+ path : internal/api/ui/
782+
783+ - name : Cross-compile for darwin/arm64 (no macOS runner needed)
784+ env :
785+ GOOS : darwin
786+ GOARCH : arm64
787+ CGO_ENABLED : ' 0'
788+ run : go build -trimpath -o /dev/null ./cmd/stem/
789+
750790 # ============================================================================
751791 # Lighthouse Performance Audit
752792 # ============================================================================
@@ -933,6 +973,7 @@ jobs:
933973 - i18n
934974 - docs
935975 - build
976+ - darwin-compile-check
936977 if : always()
937978 steps :
938979 - name : Verify upstream results
0 commit comments