Repository navigation
Add the Release workflow: a version bump that merges tags the release (install.md chunk 2) - #205
Conversation
… (install.md chunk 2) scripts/release.ts raises package.json's version, and once a bump reaches main, tags it vX.Y.Z, moves v0, and creates the GitHub release. .github/workflows/release.yml runs it the way Projector's Release workflow does. A release publishes no files: install.md §7.1 now records that whoever installs Field builds the daemon, so no JUCE binary is distributed, and §7.3 that any later prebuilt binary builds locally.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.4 · model claude-opus-5-5 · effort xhigh · CHANGES REQUESTED · took 10m 00s
This pull request adds Field's release flow, modeled on Projector's. You start the Release workflow by hand with patch, minor, or major, and it opens a pull request that raises the version in package.json. Merging that pull request tags vX.Y.Z, moves the major tag v0, and creates a GitHub release that carries no files. The install plan now decides that Field publishes no daemon binary, because a published binary would be a distribution under JUCE's and the VST3 SDK's copyleft terms. scripts/release.ts does each step under plain Node 24. The change knowingly leaves the propose job unable to open its pull request until the repository lets GitHub Actions create pull requests, and leaves the release installer to chunk 3.
2 finding threads: 0 resolved, 2 open
Covered 7 of 7 changed files; no generated files.
actionlint is not installed on the reviewing machine, so the workflow was checked by parsing it and running bash -n on each run step. The workflow cannot run before it merges, so its publish step was run verbatim against a local bare remote, with tag --no-release in place of tag.
Suggestions
scripts/release.ts:140: push both tags in onegit push --atomic, withrefs/tags/vX.Y.Zand+refs/tags/v0. Today a failure between the two pushes leavesvX.Y.Zon the remote andv0unmoved. A re-run of the publish job then reports the version released and exits 0 with no GitHub release, andtagrefuses the version. A remote that rejected the second push once reproduced this. Projector's script pushes the two tags separately too.docs/projects/install/readme.md:11: "Field has releases now" is not true at this head, because §9.3 still owes the first release. "Field can cut releases now" says what is.
The install plan's readiness
The install plan is in-progress before and after this change, so the change makes no new readiness claim. The questions it opens are deferred to chunk 3: how a release install links field (§3.2), and whether Windows gets an install.ps1 (§7.6). Two older questions stay open for chunks 3 and 4: which domain serves the installer (§7.4), and worker environments across release versions (§7.5).
What was checked
- Permissions and injection. The workflow grants
contents: writeto both jobs andpull-requests: writeonly to the propose job. Every${{ }}value reaches the shell throughenv:.bumpis achoiceinput, and the script exits 2 on any other value. - Triggers. Only a push to
mainthat changespackage.jsonruns the publish job, and no pull request, from a fork or not, can make that push. A version that is already tagged makesreleasedexit 0, andtagrefuses it. - The ruleset. The one ruleset, the organization's
main, covers only the default branch: no deletion, no force push, linear history, squash merges, and resolved threads, with no required status checks. The release flow never pushes tomain. No ruleset covers tags orrelease/*, so the force-movedv0and the force-pushed release branch are allowed. A release pull request thatGITHUB_TOKENopens runs no CI, and nothing requires it to. - The script.
bump majoron 0.x gives 1.0.0, andsetcompares versions numerically.tagreadsorigin/main, so a dirty or stale checkout cannot name a release.gitandghrun throughspawnSyncwith argument arrays, never through a shell. - Projector. The workflow and script match Projector's
release.ymlandrelease.pystep for step. The differences the pull request does not explain are the untagged starting version in the first thread and the real GitHub URL in the tests in the second. - Runs at this head.
pnpm install --frozen-lockfile,pnpm typecheck,project check, andvitest run src/release.test.ts, with 14 tests passed. CI passed onlinuxandwindows. - Docs. The plan's §3.1, §3.2, §7.1, and §7.3 citations resolve. So do
native/audiod/src/version.h,DAEMON_VERSIONin theacedandvoicedworkers'protocol.py, JUCE'sFetchContentinnative/audiod/CMakeLists.txt,field --version's daemon report, andcan_approve_pull_request_reviewsbeingfalse. TheAGENTS.mdedit is in the docs list, outside the Projector-generated section.
…fig says src/release.test.ts configured origin as https://github.com/okamnesiac/field.git and reached its bare repository through a local insteadOf rule. The script's own git processes read the user's ~/.gitconfig, and git applies a pushInsteadOf rule there to the configured URL, so a common rule such as `[url "[email protected]:"] pushInsteadOf = https://github.com/` sent the suite's v0.1.0 and v0 tags to the real repository. origin is now the bare repository's path, and every git process the file starts, the script's included, runs with GIT_CONFIG_GLOBAL set to the null device, GIT_CONFIG_NOSYSTEM, and no other GIT_ variable, so neither a rule in the user's or the system's config nor a GIT_DIR exported by a git hook can redirect it. The script now reads the GitHub repository inside the step that creates the release, through githubRepo, so the tests can stub that step without configuring a GitHub URL. A new test writes pushInsteadOf rules for GitHub and for the bare repository's directory into a stand-in home directory, and checks that the tags reach origin and not the decoy the rules point at. Against the previous setup it fails with both tags in the decoy.
… never ships by accident The publish job ran `released`, and `tag` when that exited 3, which it does whenever main's version has no tag. main starts at 0.1.0 with no tag, so the first pull request to touch package.json in any way, such as a new script, would have tagged v0.1.0, created v0, and published a v0.1.0 GitHub release. Running the publish step against a local bare remote after a script-only change did exactly that. `released --since COMMIT` now also exits 0 when origin/main's version is not above COMMIT's, and the publish job passes it github.event.before, main's commit before the push. A change that leaves the version alone releases nothing, and so does a revert that lowers it. The same step run against a local bare remote now releases nothing after a script-only change, and tags v0.2.0 after a minor bump. docs/release.md and install.md §3.1 and §9 describe the check, and §9.1 records why a baseline v0.1.0 tag was not the fix.
tag pushed vX.Y.Z and then v0 in two pushes. A failure between them left the release tag on the remote without its major tag, and `released` then reported the version released, so a rerun of the publish job exited 0 without moving v0 or creating the GitHub release. One `git push --atomic` with both refspecs, v0's forced, gives the remote both tags or neither. A new test has the bare repository refuse v0 alone, and checks that v0.1.0 does not land either; with two pushes it lands.
…t release is still owed The goal said "Field has releases now", but no release exists yet: §9.3 still owes the first one.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.4 · model claude-opus-5-5 · effort xhigh · CLEAN · took 9m 58s
This pull request adds Field's release flow, modeled on Projector's. You start the Release workflow by hand with patch, minor, or major, and it opens a pull request that raises the version in package.json. Merging that pull request tags vX.Y.Z, moves the major tag v0, and creates a GitHub release that carries no files, because the install plan decides that Field publishes no daemon binary under JUCE's and the VST3 SDK's copyleft terms. This head answers the review of ec2aba7. The publish job now releases only a push that raises the version, the tests can no longer push anywhere but their own bare repository, both tags go in one atomic push, and the plan's goal line says Field can cut releases.
2 finding threads: 2 resolved, 0 open
Covered 7 of 7 changed files; no generated files.
actionlint is not installed on the reviewing machine, so the workflow was checked by parsing it and running bash -n on each run step. The workflow cannot run before it merges, so its publish step was run verbatim against a local bare remote, in a fresh clone for each push, with tag --no-release in place of tag.
Suggestions
scripts/release.ts:107:mergedcounts a local tag as released.tagcreates both tags locally before it pushes, so after a refused push in a hand checkout,releasedreports the version released, andtagrefuses it with "set a new version first", though the remote has neither tag. A CI re-run starts from a fresh clone and recovers, and the base head behaves the same when its first push fails. Delete the two local tags when the push fails, or ask the remote withgit ls-remote --tags.
What was checked
- The unplanned v0.1.0 release (
.github/workflows/release.yml:88), fixed. The publish job runsreleased --since "$BEFORE", withgithub.event.beforepassed throughenv:. In the verbatim run, a push that changed only a script at untagged 0.1.0 released nothing, and a bump to 0.2.0 taggedv0.2.0and createdv0. A later script edit released nothing, a raise reverted before its run released nothing, and a re-run of the release run printed "v0.2.0 is released" and exited 0. ABEFOREthat is all zeros, empty, or a commit the clone lacks, as after a force push, exits 1 with no tags pushed, so the job fails visibly instead of releasing. The ruleset blocks force pushes tomainin any case. - Test pushes reaching GitHub (
src/release.test.ts:51), fixed.originis now the bare repository's path, and the file clears everyGIT_variable and setsGIT_CONFIG_GLOBAL=/dev/nullandGIT_CONFIG_NOSYSTEM. The suite ran withpushInsteadOfrules forhttps://github.com/and for/in~/.gitconfig, in$XDG_CONFIG_HOME/git/config, and in aGIT_CONFIG_GLOBALfile, plus a strayGIT_DIR. All 18 tests passed, and neither the decoy nor theGIT_DIRrepository received a ref. A plain git push under the same rules is redirected to the decoy path, so the rules were live. - The atomic push. A remote whose
updatehook refusesrefs/tags/v0receives neither tag, and a fresh clone then releases normally. - The plan's goal line now reads "Field can cut releases now".
- The workflow. Both
runsteps passbash -n, no${{ }}appears inside arunstep, and the permissions and triggers are unchanged from the first review. - Runs at this head.
pnpm install --frozen-lockfile,pnpm typecheck,project check, andvitest run src/release.test.ts, with 18 tests passed. CI passed onlinuxandwindows. - Docs.
docs/release.md, the plan's §3.1 table, and §9 describe--sinceand the atomic push as the code does, and §9.2's account of the verbatim run matches the run above. - The install plan's readiness. The plan is
in-progressbefore and after this change, and this head opens no new question.
… can be run again merged() decided whether a version was released from the local tag list, and tag() makes both tags locally before it pushes them. After a push the remote refused, in a checkout run by hand, `released` reported the version released and `tag` refused it with "set a new version first", though the remote had neither tag. A CI rerun recovered only because it starts from a fresh clone. merged() now asks the remote with `git ls-remote --tags`, and fetches the branch with --no-tags, since local tags no longer decide anything. tag() creates the release tag with -f as it already did the major tag, because a local tag of that name can only be one a refused push left behind. A new test has the remote refuse the push, then checks that the next run reports the version unreleased and tags it; before this change `merged` reported it tagged. Without -f the run stops at "tag 'v0.1.0' already exists". Another assertion checks that `released` still sees the remote's tags from a checkout that has none, as in a fresh clone. docs/release.md and install.md §3.1 and §9 describe the check. The §3.1 paragraph about the publish job is also rewrapped.
ninjudd
left a comment
There was a problem hiding this comment.
📽️ Projector review · 0.7.4 · model claude-opus-5-5 · effort xhigh · CLEAN · took 14m 10s
This pull request adds Field's release flow, modeled on Projector's. You start the Release workflow by hand with patch, minor, or major, and it opens a pull request that raises the version in package.json. Merging that pull request tags vX.Y.Z, moves the major tag v0, and creates a GitHub release that carries no files, because the install plan decides that Field publishes no daemon binary under JUCE's and the VST3 SDK's copyleft terms. This head takes the last review's suggestion: released and tag ask the remote with git ls-remote whether a version is tagged, instead of trusting local tags, so a release whose push the remote refused can be run again from the same checkout.
2 finding threads: 2 resolved, 0 open
Covered 7 of 7 changed files; no generated files.
actionlint is not installed on the reviewing machine. The workflow did not change since the last review, which parsed it and ran bash -n on each run step. Its publish step was run verbatim against a local bare remote again, in a fresh clone for each push, with tag --no-release in place of tag.
What was checked
- A refused push, run again by hand. A remote whose
updatehook refusedrefs/tags/v0received neither tag, though the checkout kept both local tags.releasedin that checkout then printed "v0.2.0 is not released yet" and exited 3.tagreplaced the stale local tags, pushedv0.2.0andv0tomain's commit, and exited 0. After that,releasedexited 0, and a thirdtagrefused the version. - The CI path is unchanged. The same verbatim runs as on
923a58fgave the same results. A script edit at untagged 0.1.0 released nothing, a bump to 0.2.0 taggedv0.2.0and createdv0, and a later script edit and a reverted raise released nothing. A re-run of the release run exited 0, and an all-zero, empty, or unfetchedBEFOREexited 1 with no tags pushed. A second release, to 0.3.0, movedv0over the copy the clone had fetched and leftv0.2.0in place. - The remote query.
git ls-remote --tags origin refs/tags/vX.Y.Zmatches that tag and not its lookalikes:v10.1.0,v0.1.0-rc1,release/v0.1.0, andv0.1on the remote do not count asv0.1.0. In the workflow,actions/checkoutkeeps its credentials fororigin, so the query authenticates the way the existing fetch does. - Forcing the release tag locally replaces only a local tag.
tagruns only when the remote lacks the release tag, and the push still sendsrefs/tags/vX.Y.Zwithout+, so a tag that reached the remote in the meantime fails the whole atomic push. - Comments and docs. The two new comments in
scripts/release.tsgive reasons the code cannot show.docs/release.md, the plan's §3.1 table, and §9.1 and §9.2 describe the remote query and the retry as the code does, and nothing still says that tags are fetched with--force. - Runs at this head.
pnpm install --frozen-lockfile,pnpm typecheck,project check, andvitest run src/release.test.ts, with 19 tests passed, the new retry test among them. CI passed onlinuxandwindows. - The install plan's readiness. The plan is
in-progressbefore and after this change, and this head opens no new question.
The Release workflow opened #207, its first release pull request, and its CI did not run until Justin approved it. For a pull request that a workflow's own token opened, GitHub creates the `pull_request` run but holds it as `action_required`, so a release would wait on a click every time. `workflow_dispatch` runs need no approval. The propose job now runs `gh workflow run ci.yml --ref release/vX.Y.Z` right after it opens the pull request, or after it finds one already open on a re-run, and `ci.yml` gains `workflow_dispatch` as a trigger. A dispatched run's checks land on the branch's commit, which is the pull request's head, so they show on the release pull request like any other CI. The held `pull_request` run still appears, and the docs tell the reviewer to leave it unapproved, because approving it runs every job a second time. The propose job gets `actions: write` for the dispatch, and the default token permission stays read-only. Two alternatives lost. Approving the held run by hand needs no workflow change, but it is a click on every release. A GitHub App token would avoid the hold, but it needs an App and two secrets to do what one extra trigger does. `docs/release.md` now explains why CI is dispatched. It also names the three levels that must allow GitHub Actions to open pull requests: the enterprise (`amnesiac`, under Policies > Actions), the organization, and the repository. The first release run found out the hard way that the repository's checkbox stays greyed out until the enterprise allows it. The release pull request's own Testing text now describes `released --since`, which #205 introduced, and mentions the dispatched CI. Plan §9.1 records both of these points. ## Testing From the repository root of a checkout of `release-ci`: 1. `node -e "const y=require('yaml');for (const f of ['.github/workflows/ci.yml','.github/workflows/release.yml']) { const w=y.parse(require('fs').readFileSync(f,'utf8')); console.log(f, Object.keys(w.on), JSON.stringify(w.jobs.propose?.permissions ?? '')) }"` should print `[ 'push', 'pull_request', 'workflow_dispatch' ]` for `ci.yml`. For `release.yml` it should print `[ 'workflow_dispatch', 'push' ]` and `{"actions":"write","contents":"write","pull-requests":"write"}`. Every `run` step in both files passes `bash -n`. 2. `pnpm exec vitest run src/release.test.ts` should report 19 passed (the script is unchanged), and `project check` should print `Project plans are valid.` The dispatch can't be exercised before this merges, because GitHub dispatches a workflow only once its `workflow_dispatch` trigger is on the default branch. After the merge, run Actions > Release with `minor` again while #207 is still open. The propose job will bump 0.1.0 on the new `main`, force-push `release/v0.2.0`, report `a pull request from release/v0.2.0 is already open`, and dispatch CI. #207 should then list the `linux` and `windows` checks on its new head. If the dispatch step fails with `Workflow does not have 'workflow_dispatch' trigger`, `main` doesn't have this change yet. <!-- projector-summary v=1 sha=6c2f933eae83cdd5c866f0fd2446c26aa9a8e154 --> 📽️ **Projector summary** of 6c2f933: https://field.amnes.ac/reviews/208
Field had no way to cut a release.
package.jsonhas said 0.1.0 since the start, and the repository has no tags and no GitHub releases. The one-line install in the install plan needs a release channel to follow, so this adds the release flow Projector uses. You start the Release workflow by hand withpatch,minor, ormajor, and it opens a pull request that raises the version inpackage.json. Merging that pull request is the decision to ship: the workflow then tagsvX.Y.Zon the merge commit, moves the major tagv0to it in the same atomic push, and creates the GitHub release with generated notes.scripts/release.tsdoes each step and also works by hand. It asks the remote, never the local tags, whether a version is already tagged, so a push the remote refused can simply be run again. Node 24 runs it directly by stripping its types, so the workflow installs no dependencies.Only a merge that raises the version releases. The publish job passes
github.event.beforetoreleased --since, which exits 0 unless the push raised the version. Without that check, the untagged 0.1.0 would ship on the first change topackage.jsonof any kind, such as a new script. Plan §9.1 records why this beat tagging 0.1.0 as a baseline.A release publishes no files, and that is a decision this change records in the plan.
field-audiodlinks JUCE (AGPLv3 or commercial) and the VST3 SDK that JUCE 8.0.4 bundles (GPLv3 or proprietary). Publishing a prebuilt daemon would therefore distribute it under those copyleft terms, or require both commercial licenses. Plan §7.1 is now DECIDED: Field publishes no daemon binary, and whoever installs Field builds it. JUCE isn't in the repository either; CMake fetches it at build time. Because every user needs a compiler for the daemon anyway, a prebuilt CLI would save only the three secondstsctakes, so the plan drops it too. A release is just a tag, and the release installer (chunk 3) will run the same steps a checkout install runs. §4's decision that releases ship built artifacts is amended with that reason. §7.3 is DECIDED too: if prebuilt binaries ever come, they build locally on a maintainer's Mac rather than on a macOS runner. The plan keeps the JUCE 8.0.11 note, because that release makes the VST3 SDK MIT, for the day binaries are worth making.The release version is
package.json's alone.field-audiodand the model workers keep their own versions, which they report inhelloand stamp into take manifests, so a release leaves them alone.docs/release.mdexplains how to cut a release, run the steps by hand, and why those versions don't move.One repository setting stands between this and a fully automatic first release: Settings > Actions > General > Workflow permissions > Allow GitHub Actions to create and approve pull requests is off (
can_approve_pull_request_reviews: false). With it off, the propose job pushes therelease/vX.Y.Zbranch, fails, and prints the link that opens the pull request by hand, and merging that pull request still publishes the release. This change doesn't flip the setting.Testing
From the repository root of a checkout of
release-workflow, afterpnpm install --frozen-lockfile:pnpm exec vitest run src/release.test.tsshould report 19 tests passed. The tests run the script against a temporary repository whoseoriginis the path of a bare repository beside it, never a GitHub URL. Every git process the file starts, the script's included, runs withGIT_CONFIG_GLOBAL=/dev/null,GIT_CONFIG_NOSYSTEM=1, and no otherGIT_variable, so neither a rule in your git config nor aGIT_DIRexported by a hook can send a push anywhere else. One test writespushInsteadOfrules into a stand-in home directory and checks that the tags still reachoriginand never the decoy the rules point at. If that test fails, the suite's pushes can be redirected, and nothing else should be run until it passes. The other tests cover eachbumppart,setrefusing a version that does not go up (0.9.0 after 0.10.0 included),tagpushingvX.Y.Zand movingv0on a second release while the first tag stays put, a remote that refusesv0receiving neither tag, a second run releasing after the remote refused the first run's push, tagging whatorigin/mainholds rather than an unpushed bump,releasedreading the remote's tags from a checkout that has none, refusing a version that is already tagged, a remote that is not GitHub, the GitHub repository read from a remote's configured URL rather than itsinsteadOfrewrite, a failed GitHub release naming thegh release createcommand that finishes it,releasedexiting 3 and then 0,released --sincereleasing nothing unless the version went up, and plainnoderunning the file with no warning. A failure in the last test means Node no longer runs the file directly, and the workflow would fail the same way.node scripts/release.tswith no arguments should exit 2 and printusage: node scripts/release.ts bump patch|minor|major | set X.Y.Z | released [--since COMMIT] | tag [--no-release].node scripts/release.ts releasedshould printv0.1.0 is not released yetand exit 3. It fetchesorigin/mainwithout tags, readspackage.jsonthere, and asksoriginfor av0.1.0tag withgit ls-remote. It changes nothing in your checkout exceptorigin/main.node scripts/release.ts released --since origin/mainshould printv0.1.0 is not above v0.1.0 at <sha>, so there is nothing to releaseand exit 0. This is the answer the publish job gets after a merge that leaves the version alone. If it printsnot released yetand exits 3 instead, such a merge would publish v0.1.0. Don't runtagorbumphere unless you mean to release, becausetagpushes real tags to GitHub.The full gate passed on this head:
pnpm install --frozen-lockfile && pnpm typecheck && pnpm build && pnpm test && project checkgave 84 files, 1098 passed and 1 skipped, with valid plans. Eachrunstep in.github/workflows/release.ymlpassesbash -n. The workflow itself can't run before it merges, so its publish step was run verbatim against a local bare remote, withtag --no-releasein place oftag. After a push that changed only a script inpackage.json, it released nothing, and after abump minorpush, it taggedv0.2.0and createdv0. The first real run is the first release: run the Release workflow withminorto release 0.2.0, which tagsv0.2.0and createsv0.📽️ Projector summary of 9dc8b35: https://field.amnes.ac/reviews/205