Skip to content

Add the Release workflow: a version bump that merges tags the release (install.md chunk 2) - #205

Merged
ninjudd merged 6 commits into
mainfrom
release-workflow
Oct 11, 2026
Merged

ninjudd merged 6 commits into
mainfrom
release-workflow

Conversation

@ninjudd

@ninjudd ninjudd commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Field had no way to cut a release. package.json has 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 with patch, minor, or major, and it opens a pull request that raises the version in package.json. Merging that pull request is the decision to ship: the workflow then tags vX.Y.Z on the merge commit, moves the major tag v0 to it in the same atomic push, and creates the GitHub release with generated notes. scripts/release.ts does 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.before to released --since, which exits 0 unless the push raised the version. Without that check, the untagged 0.1.0 would ship on the first change to package.json of 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-audiod links 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 seconds tsc takes, 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-audiod and the model workers keep their own versions, which they report in hello and stamp into take manifests, so a release leaves them alone. docs/release.md explains 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 the release/vX.Y.Z branch, 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, after pnpm install --frozen-lockfile:

  1. pnpm exec vitest run src/release.test.ts should report 19 tests passed. The tests run the script against a temporary repository whose origin is the path of a bare repository beside it, never a GitHub URL. Every git process the file starts, the script's included, runs with GIT_CONFIG_GLOBAL=/dev/null, GIT_CONFIG_NOSYSTEM=1, and no other GIT_ variable, so neither a rule in your git config nor a GIT_DIR exported by a hook can send a push anywhere else. One test writes pushInsteadOf rules into a stand-in home directory and checks that the tags still reach origin and 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 each bump part, set refusing a version that does not go up (0.9.0 after 0.10.0 included), tag pushing vX.Y.Z and moving v0 on a second release while the first tag stays put, a remote that refuses v0 receiving neither tag, a second run releasing after the remote refused the first run's push, tagging what origin/main holds rather than an unpushed bump, released reading 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 its insteadOf rewrite, a failed GitHub release naming the gh release create command that finishes it, released exiting 3 and then 0, released --since releasing nothing unless the version went up, and plain node running 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.
  2. node scripts/release.ts with no arguments should exit 2 and print usage: node scripts/release.ts bump patch|minor|major | set X.Y.Z | released [--since COMMIT] | tag [--no-release].
  3. node scripts/release.ts released should print v0.1.0 is not released yet and exit 3. It fetches origin/main without tags, reads package.json there, and asks origin for a v0.1.0 tag with git ls-remote. It changes nothing in your checkout except origin/main.
  4. node scripts/release.ts released --since origin/main should print v0.1.0 is not above v0.1.0 at <sha>, so there is nothing to release and exit 0. This is the answer the publish job gets after a merge that leaves the version alone. If it prints not released yet and exits 3 instead, such a merge would publish v0.1.0. Don't run tag or bump here unless you mean to release, because tag pushes real tags to GitHub.

The full gate passed on this head: pnpm install --frozen-lockfile && pnpm typecheck && pnpm build && pnpm test && project check gave 84 files, 1098 passed and 1 skipped, with valid plans. Each run step in .github/workflows/release.yml passes bash -n. The workflow itself can't run before it merges, so its publish step was run verbatim against a local bare remote, with tag --no-release in place of tag. After a push that changed only a script in package.json, it released nothing, and after a bump minor push, it tagged v0.2.0 and created v0. The first real run is the first release: run the Release workflow with minor to release 0.2.0, which tags v0.2.0 and creates v0.

📽️ Projector summary of 9dc8b35: https://field.amnes.ac/reviews/205

… (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 ninjudd left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📽️ 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 one git push --atomic, with refs/tags/vX.Y.Z and +refs/tags/v0. Today a failure between the two pushes leaves vX.Y.Z on the remote and v0 unmoved. A re-run of the publish job then reports the version released and exits 0 with no GitHub release, and tag refuses 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: write to both jobs and pull-requests: write only to the propose job. Every ${{ }} value reaches the shell through env:. bump is a choice input, and the script exits 2 on any other value.
  • Triggers. Only a push to main that changes package.json runs the publish job, and no pull request, from a fork or not, can make that push. A version that is already tagged makes released exit 0, and tag refuses 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 to main. No ruleset covers tags or release/*, so the force-moved v0 and the force-pushed release branch are allowed. A release pull request that GITHUB_TOKEN opens runs no CI, and nothing requires it to.
  • The script. bump major on 0.x gives 1.0.0, and set compares versions numerically. tag reads origin/main, so a dirty or stale checkout cannot name a release. git and gh run through spawnSync with argument arrays, never through a shell.
  • Projector. The workflow and script match Projector's release.yml and release.py step 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, and vitest run src/release.test.ts, with 14 tests passed. CI passed on linux and windows.
  • Docs. The plan's §3.1, §3.2, §7.1, and §7.3 citations resolve. So do native/audiod/src/version.h, DAEMON_VERSION in the aced and voiced workers' protocol.py, JUCE's FetchContent in native/audiod/CMakeLists.txt, field --version's daemon report, and can_approve_pull_request_reviews being false. The AGENTS.md edit is in the docs list, outside the Projector-generated section.

Comment thread .github/workflows/release.yml Resolved
Comment thread src/release.test.ts Resolved
@ninjudd
ninjudd marked this pull request as draft October 11, 2026 17:57
…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 ninjudd left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📽️ 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: merged counts a local tag as released. tag creates both tags locally before it pushes, so after a refused push in a hand checkout, released reports the version released, and tag refuses 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 with git ls-remote --tags.

What was checked

  • The unplanned v0.1.0 release (.github/workflows/release.yml:88), fixed. The publish job runs released --since "$BEFORE", with github.event.before passed through env:. 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 tagged v0.2.0 and created v0. 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. A BEFORE that 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 to main in any case.
  • Test pushes reaching GitHub (src/release.test.ts:51), fixed. origin is now the bare repository's path, and the file clears every GIT_ variable and sets GIT_CONFIG_GLOBAL=/dev/null and GIT_CONFIG_NOSYSTEM. The suite ran with pushInsteadOf rules for https://github.com/ and for / in ~/.gitconfig, in $XDG_CONFIG_HOME/git/config, and in a GIT_CONFIG_GLOBAL file, plus a stray GIT_DIR. All 18 tests passed, and neither the decoy nor the GIT_DIR repository 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 update hook refuses refs/tags/v0 receives neither tag, and a fresh clone then releases normally.
  • The plan's goal line now reads "Field can cut releases now".
  • The workflow. Both run steps pass bash -n, no ${{ }} appears inside a run step, and the permissions and triggers are unchanged from the first review.
  • Runs at this head. pnpm install --frozen-lockfile, pnpm typecheck, project check, and vitest run src/release.test.ts, with 18 tests passed. CI passed on linux and windows.
  • Docs. docs/release.md, the plan's §3.1 table, and §9 describe --since and 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-progress before and after this change, and this head opens no new question.

@ninjudd
ninjudd marked this pull request as ready for review October 11, 2026 18:26
@ninjudd
ninjudd marked this pull request as draft October 11, 2026 18:28
… 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 ninjudd left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📽️ 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 update hook refused refs/tags/v0 received neither tag, though the checkout kept both local tags. released in that checkout then printed "v0.2.0 is not released yet" and exited 3. tag replaced the stale local tags, pushed v0.2.0 and v0 to main's commit, and exited 0. After that, released exited 0, and a third tag refused the version.
  • The CI path is unchanged. The same verbatim runs as on 923a58f gave the same results. A script edit at untagged 0.1.0 released nothing, a bump to 0.2.0 tagged v0.2.0 and created v0, 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 unfetched BEFORE exited 1 with no tags pushed. A second release, to 0.3.0, moved v0 over the copy the clone had fetched and left v0.2.0 in place.
  • The remote query. git ls-remote --tags origin refs/tags/vX.Y.Z matches that tag and not its lookalikes: v10.1.0, v0.1.0-rc1, release/v0.1.0, and v0.1 on the remote do not count as v0.1.0. In the workflow, actions/checkout keeps its credentials for origin, so the query authenticates the way the existing fetch does.
  • Forcing the release tag locally replaces only a local tag. tag runs only when the remote lacks the release tag, and the push still sends refs/tags/vX.Y.Z without +, 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.ts give 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, and vitest run src/release.test.ts, with 19 tests passed, the new retry test among them. CI passed on linux and windows.
  • The install plan's readiness. The plan is in-progress before and after this change, and this head opens no new question.

@ninjudd
ninjudd marked this pull request as ready for review October 11, 2026 18:46
@ninjudd
ninjudd merged commit 48302bc into main Oct 11, 2026
2 checks passed
@ninjudd
ninjudd deleted the release-workflow branch October 11, 2026 19:01
ninjudd added a commit that referenced this pull request Oct 11, 2026
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
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.

1 participant