Skip to content

ci: label-gated signed macOS test build for PRs#3244

Merged
gantoine merged 3 commits into
mainfrom
posthog-code/pr-build-installer
Jul 7, 2026
Merged

ci: label-gated signed macOS test build for PRs#3244
gantoine merged 3 commits into
mainfrom
posthog-code/pr-build-installer

Conversation

@gantoine

@gantoine gantoine commented Jul 7, 2026

Copy link
Copy Markdown
Member

What

Adds .github/workflows/pr-build-installer.yml — an on-demand workflow that produces a downloadable, signed macOS (Apple Silicon) test build for a PR.

Applying the build-installer label to a same-repo PR:

  1. Packages apps/code (electron-vite build + electron-builder --mac --arm64), reusing the signed-packaging recipe from code-build-test.yml (S3 fonts, liquid-glass icon, code signing; SKIP_NOTARIZE=1).
  2. Uploads the .dmg/-mac.zip as a code-macos-arm64 run artifact (7-day retention).
  3. Posts a sticky PR comment linking to the artifact, with launch guidance for the unnotarized build.

It rebuilds on each push while the label is present.

Why

Lets reviewers/dogfooders download and run a real build of a PR on their own Mac without checking out and building locally.

Design notes

  • Label-gated only (no workflow_dispatch, no run on every PR) — full signed packaging is heavy, so it runs only when explicitly requested.
  • arm64 only (Apple Silicon).
  • Same-repo PRs only — fork PRs never receive the signing/AWS secrets, so they're skipped rather than failing.
  • Signed but not notarized — testers right-click → Open (or xattr -dr com.apple.quarantine) on first launch. Notarization stays in the tag release pipeline (code-release.yml).
  • Not wired into required checks, so it doesn't affect the Trunk merge queue.

Prerequisite

The build-installer label must exist in the repo:

gh label create build-installer --description "Trigger a signed macOS test build on this PR" --color 0e8a16

Testing

Because pull_request runs the workflow from the PR branch, this can be validated live by adding the build-installer label to this PR once the label exists.


Created with PostHog Code

Add .github/workflows/pr-build-installer.yml. Applying the
`build-installer` label to a same-repo PR packages apps/code as a
signed (unnotarized) arm64 macOS .dmg/.zip, uploads it as a run
artifact, and posts a sticky PR comment linking to the download.
Rebuilds on each push while the label is present.

Generated-By: PostHog Code
Task-Id: 95ef6c10-a78d-4099-8606-789050d9b3e2
@trunk-io

trunk-io Bot commented Jul 7, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@gantoine gantoine marked this pull request as ready for review July 7, 2026 19:32
@gantoine gantoine requested a review from a team July 7, 2026 19:32
@greptile-apps

greptile-apps Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "ci: add label-gated signed macOS test bu..." | Re-trigger Greptile

Comment thread .github/workflows/pr-build-installer.yml
Comment thread .github/workflows/pr-build-installer.yml
gantoine added 2 commits July 7, 2026 15:48
Run the comment job on build success OR failure (skipping only when
build-macos itself was skipped), and write a "build failed" update
when the packaging job fails. Previously the comment job needed
build-macos success, so a failed re-run left the prior "ready"
comment pointing at artifacts from a different commit.

Generated-By: PostHog Code
Task-Id: 95ef6c10-a78d-4099-8606-789050d9b3e2
The comment job only calls the GitHub API to post/update a PR comment;
it never checks out or reads repository files. Remove contents:read to
follow least privilege.

Generated-By: PostHog Code
Task-Id: 95ef6c10-a78d-4099-8606-789050d9b3e2
@gantoine gantoine merged commit ca288d4 into main Jul 7, 2026
25 checks passed
@gantoine gantoine deleted the posthog-code/pr-build-installer branch July 7, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants