Repository navigation
Release build: host the UI on GitHub Pages, one folder per release - #76
Merged
Merged
Conversation
The Release build workflow takes a version, publishes dist/ui to releases/<version>/ on the gh-pages branch (never overwriting a release) and builds the sandbox against that URL. The manifest allows opral.github.io and drops the retired parrot-global and api.parrot.global hosts. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ifact copy docs/releasing.md describes the release flow (version, releases/<version>/ on gh-pages, manual Figma publish, how to test a release). The QA harness finds the hosted UI by PARROT_UI_ORIGIN, can refuse input unless the file tab is in front (QA_FRONT) and has a probe for console, CSP/CORS and network of the hosted UI. The publish job refuses symlinks and git metadata in the UI build. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…al versions Review findings: the Pages verification runs in its own job so it can be re-run alone, the UI URL baked into the sandbox, the entry script and the WASM file are checked before anything is published, symlinks are refused in the whole release, versions without a pre-release suffix can only be released from dev, the existing-release check is case-insensitive in the build job too, the Pages README is created when missing, jobs have timeouts and the manifest reasoning says hashed ids instead of anonymous. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The new Parrot (SDK 4 + Inlang editor) needs its UI hosted: it uses module workers and WebAssembly, so the plugin sandbox loads it from a URL whose origin is in
networkAccess.allowedDomains. Nothing was hosted (opral.github.io/parrot-figma/returned 404,parrot-global.github.iois dead). This PR hosts every release on GitHub Pages of this repository, one folder per release, and never on a merge..github/workflows/publish.yml, manual): the free-formui_urlinput is replaced byversion. The workflow deriveshttps://opral.github.io/parrot-figma/releases/<version>/, builds the sandbox with thatVITE_CUSTOM_URL, buildsrelease/manifest.json(still fails when the origin is not inallowedDomains), uploads theparrot-figma-pluginartifact as before and publishesdist/uitoreleases/<version>/on thegh-pagesbranch.versionis validated (^[0-9A-Za-z]([0-9A-Za-z._-]{0,62}[0-9A-Za-z])?$: no./.., no leading dash or trailing dot, no slash) before anything uses it and only ever reaches scripts through environment variables. An existing version (case-insensitive) is refused, early in the build job and again under the lock in the publish job. Versions without a-suffix can only be built fromdev(other branches build pre-releases such as1.2.3-beta1).buildhascontents: read, runs all repository and dependency code and checks the release files (entry page and script, a.wasm, the UI URL baked intodist/plugin.js, no symlinks) before anything is published;publishis the only job withcontents: write, runs no repository code (it downloads the artifact, copies it intoreleases/<version>/, checks that nothing else changed, commits asgithub-actions[bot]and pushes without force; serialized by therelease-pagesconcurrency group; creates thegh-pagesbranch with a README and.nojekyllif missing);verifywaits until Pages serves the release and checks status,Content-TypeandAccess-Control-Allow-Originof the page, its entry script and the WebAssembly file, and prints the URL, the checks and the exact manual Figma publish steps in the job summary. It is its own job so it can be re-run alone.devpublishes nothing (nopushtrigger, CI does not touchgh-pages).manifest.json, kept in sync withmanifest.figma.tsby a new test):https://opral.github.ioadded;https://parrot-global.github.ioandhttps://api.parrot.globalremoved;reasoningrewritten (hosted UI on GitHub Pages, anonymous usage counts via inlang.com/relay, s3-alpha.figma.com = Figma profile pictures). Pluginidunchanged.parrot-global.github.io: only thecheckVersion()insrc/ui/ui.tsx, whose call is commented out.api.parrot.global: onlyParrotApi, unreachable (SYNC_CREDITS = false,activateLicensehas no caller, payment feature flag is off). Both were absent from the network log of the live run.s3-alpha.figma.comis kept: it servesfigma.currentUser.photoUrl, whose only consumer is the (currently hidden) Users view. It can go when that view is removed.docs/releasing.md: the release flow (version,releases/<version>/ongh-pages, how to test a release, manual publish steps in the Figma desktop app). README untouched..qa/): tools find the hosted UI iframe byPARROT_UI_ORIGIN,QA_FRONT=<file id>refuses real input unless that file's tab is in front, newhosted-probe.mjs(console, CSP/CORS/network of the hosted UI) andnet-all.mjs(requests of a file tab), documented in.qa/README.md.Repo setting changed (done with
gh api, not part of the diff): Pages source is now branchgh-pages/ root (it was build typeworkflow, sourcedev). Publishing to the Figma Community stays manual.Verified live (Release build runs from this branch, real Figma Desktop)
Released files (
release/manifest.json+dist/plugin.jsof the artifact) run in Figma with the UI fromhttps://opral.github.io/parrot-figma/releases/0.0.0-test1/:https://opral.github.io(CDP target +location.origin), its module workerassets/entry.browser-*.jsand both WASM files load from there; no console errors, CSP, CORS or failed requests (a fresh UI load makes only requests toopral.github.ioandinlang.com/relay)https://inlang.com/relay/i/v0/e/(counts and hashed ids, no texts or keys); nothing else leaves../eviland a non-pre-release version from this branch fail in the build job before anything is built; a final run with the three-job workflow published and verifiedPages serves
application/wasm,application/javascript; charset=utf-8andAccess-Control-Allow-Origin: *; a push of the workflow triggers the Pages build (served in under a minute).Notes
0.0.0-test*were removed fromgh-pagesagain.gh-pagesagainst force pushes and deletion.pnpm tsc && pnpm lint && pnpm test && pnpm buildpass.🤖 Generated with Claude Code