Skip to content

PR preview workflow: per-PR web URL + Windows/macOS builds (#77)#78

Merged
petegordon merged 1 commit into
mainfrom
claude/issue-77-pr-preview
Jun 19, 2026
Merged

PR preview workflow: per-PR web URL + Windows/macOS builds (#77)#78
petegordon merged 1 commit into
mainfrom
claude/issue-77-pr-preview

Conversation

@petegordon

Copy link
Copy Markdown
Member

Closes #77.

Mirrors the PR-preview workflow in petegordon/tandemonium and extends it with the desktop installers, so a PR can be tested fully and in isolation. Built per the decisions on #77: migrate Pages to gh-pages, deliver desktop via per-PR prerelease, internal branches only.

What a PR gets

One sticky comment linking:

  • 🌐 Web overlay — deployed to gh-pages under https://lab.usersfirst.games/pr-preview/pr-<N>/overlay/ via rossjrw/pr-preview-action.
  • 💻 Desktop installers — Windows .exe + macOS .dmg/zip, published as a prerelease tagged pr-<N> (stable, clickable download URLs).

Both are torn down on close: the web preview by the action, and the prerelease + tag by a cleanup job.

Files

  • .github/workflows/pr-preview.yml (new) — pull_request [opened, synchronize, reopened, closed]. Jobs: web-preview, build-macos, build-windows (reuse the proven build-desktop.yml steps), prerelease, comment, and cleanup. Every job is guarded on head.repo == this repo (internal only — fork PRs get a read-only token and can't publish anyway).
  • .github/workflows/deploy-pages.yml — reworked to publish prod to the gh-pages branch root (peaceiris/actions-gh-pages, keep_files: true) so prod and the pr-preview/ umbrella coexist on one Pages site. Custom domain preserved via the CNAME build-web.js emits (+ cname:). gh-pages writes serialized across both workflows via a shared gh-pages-write concurrency group.
  • apps/overlay/README.md — documents the preview flow and the one-time setting.

⚠️ One-time manual step (repo admin) — required at merge

This switches the Pages source from "GitHub Actions" to a branch. After merging:

Settings → Pages → Build and deployment → Source = "Deploy from a branch" → Branch = gh-pages / (root).

Until that's flipped, the new deploy-pages.yml will publish to gh-pages but the live site won't serve from it. The custom domain (lab.usersfirst.games) carries over via CNAME. Recommend merging this when you can flip the setting right after (first deploy-pages run after merge creates the gh-pages branch).

Notes / tradeoffs

  • Prereleases are marked prerelease: true + make_latest: false, so they never displace the rolling webhid-overlay-latest release the landing page tracks.
  • keep_files: true on the prod deploy means files removed from prod aren't pruned from gh-pages — chosen so a prod deploy never wipes in-flight pr-preview/ dirs. Acceptable; can revisit.
  • Fork PRs are intentionally unsupported (security: pull_request_target with untrusted build code is unsafe).
  • CI can't be fully exercised until merged + the Pages setting is flipped (workflows only run from main / on PRs against the merged definition). YAML validated locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_017NiS2a4jZ877XgftkH1Dd1


Generated by Claude Code

#77)

Mirrors the PR-preview workflow in petegordon/tandemonium and extends it with
the desktop installers, so a PR can be tested fully and in isolation:

- pr-preview.yml (pull_request open/sync/reopen/close, internal branches only):
  • Web overlay deployed to gh-pages pr-preview/pr-<N>/ via
    rossjrw/pr-preview-action (auto-teardown on close).
  • Windows .exe + macOS .dmg/zip published as a per-PR prerelease tagged
    pr-<N> (prerelease + not-latest so it never displaces the rolling
    landing-page release); deleted when the PR closes.
  • One sticky comment links the web URL and the desktop downloads.

- deploy-pages.yml reworked to publish prod to the gh-pages branch root
  (peaceiris/actions-gh-pages, keep_files) so prod and the pr-preview/
  umbrella share one Pages site; custom domain preserved via CNAME. gh-pages
  writes are serialized across both workflows via a shared concurrency group.

Requires a one-time repo setting: Pages source = "Deploy from a branch" →
gh-pages / (root). Documented in apps/overlay/README.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NiS2a4jZ877XgftkH1Dd1
@petegordon petegordon merged commit 1d5f6fc into main Jun 19, 2026
4 of 5 checks passed
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

🔎 PR #78 preview — torn down

This PR is closed; its web preview and desktop prerelease have been removed.

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.

Infra: PR preview workflow — per-PR web preview URL + Windows/macOS desktop builds

2 participants