Repository navigation
Release installers at fixed download links, and Windows signing on release - #1020
Conversation
A release version is now X.Y.Z, X.Y.Z-rc.N or X.Y.Z-beta.N, parsed in one place (scripts/release-version.ts), with the next version for a stable, candidate, beta or final release computed there too. desktop-version.ts takes the same grammar, so a candidate's version reaches the Cargo files and build-version.json intact, while the Apple fields keep the numeric X.Y.Z they require.
A final release cut from a release candidate must be that candidate's code. The release's parent has to carry the newest candidate tag for its version, and the two may differ only in the version written into package.json, the chart's appVersion and the openbot-desktop entries of Cargo.toml and Cargo.lock, plus CHANGELOG.md. scripts/release-candidate-check.ts says which file changed beyond that, and exits non-zero so the publish stops before anything is built.
The image build moves into a reusable images.yml, so a release and a branch build make images the same way: tagged sha-<commit>, plus a version, and moved to latest only when asked. publish-release.yml now also runs for release branches. A merged release/publish/vX.Y.Z-rc.N or -beta.N into release/X.Y publishes a GitHub prerelease with its notes from Unreleased; it is never Latest and its images are never tagged latest. A stable version merged into release/X.Y is a final release: it must pass scripts/release-candidate-check.ts first, and once published a pull request carries the release branch back into main. A stable release becomes Latest only when no newer release already is, so a patch cut from main cannot move customer installers back. Stable releases from main are otherwise unchanged.
The Desktop installer build moves into a reusable desktop-build.yml. Pull request builds call it exactly as before: unpinned, no CLI, kept seven days. Internal build (internal-build.yml) runs from any branch: it builds that commit's images, never tagged latest, and Mac and Windows installers pinned to them, kept thirty days and linked from the run summary. A release now builds its installers after its checks pass and attaches them to the GitHub release. A candidate or beta gets installers pinned to its own images; a stable release, finals included, gets customer installers, which install the latest release as today. All are ad-hoc signed, like every CI build.
desktop/intelligence-cli.json names the Intelligence CLI an installer carries: the copilotkit npm package's latest release by default, any npm version or dist-tag, or an Intelligence preview from pkg.pr.new, plus the Node version that runs it. desktop/scripts/cli-bundle.ts assembles it for one platform: Node from nodejs.org, checked against its published SHASUMS256.txt, and the CLI packed from npm with its production dependencies, then records exactly which CLI and Node went in to desktop/build-version.json. A version or URL that does not exist fails the build rather than shipping an installer without a CLI. docs/releasing.md explains the choice. On a tree without tauri.bundled-cli.conf.json, main today, nothing is bundled.
An internal or candidate installer is built with OPENBOT_PINNED_DEPLOYMENT naming its image manifest. build.rs checks it and compiles it in, with the commit it came from, and deployment::pinned() reads it back. A pinned build never asks GitHub for the latest release: it lays out its own commit's tree and images over whatever deployment is there, keeping the person's data, and records the stamp as pinned. A customer build that finds a pinned deployment moves it to the latest release, as it does for any release it no longer runs; otherwise it keeps its installed release as before. An empty or unset variable is an ordinary customer build, so cargo test is unchanged.
Create release PR takes a kind: stable (the default, exactly as before), rc, beta or final. The version, chart, Cargo and changelog changes move into scripts/release-prepare.ts, which a stable release from main runs to the same files and the same pull request as the inline steps did. The first candidate or beta, run from main, cuts release/X.Y at the chosen commit; later ones run from that branch. Their pull requests target the release branch, leave Unreleased in place as the notes, and pin a dist-tag CLI choice to the exact version it resolves, so the final release bundles what was dogfooded. A final runs from release/X.Y only when its tip is a candidate, and every refusal says what to do instead.
docs/releasing.md describes the new paths: Internal build from any branch, with pinned Mac and Windows installers kept thirty days; cutting release candidates and betas onto release/X.Y as prereleases that are never Latest; and finishing a candidate as a final release that may differ from it only in version numbers, then merges back into main. A plain patch, minor or major from main is unchanged. The CLI section now says a candidate pins any dist-tag to the exact version it resolves, and unsigned Windows installers are covered.
Whether a release becomes Latest is now decided once, in verify, before any image is built, and both the latest image tag and the GitHub Latest mark follow that one decision. A patch released from main while a newer final is out used to leave GitHub's Latest alone but still move the latest image tag back to it. Only a 404 from the latest-release lookup means there is no Latest yet. Any other failure stops the run, so an API outage cannot hand Latest, or the latest image tag, to an older release.
A release is a reviewed commit on main for a stable release and on release/X.Y for a candidate, beta or final. A plain release from main is cut as before but now also publishes installers and sha-<commit> image tags, and its images are tagged latest only when it becomes Latest. The CLI is bundled only on a tree with tauri.bundled-cli.conf.json, Publish release and Internal build pass the optional OAuth client secret, and releases are not yet signed.
…back The prerelease changelog check piped awk into grep -q under pipefail. With Unreleased past the pipe buffer, grep's early exit killed awk with SIGPIPE and every candidate and beta was refused as having no notes. awk now decides alone. A candidate pins desktop/intelligence-cli.json to an exact CLI, and the final keeps it, so merging release/X.Y straight into main froze that pin on main for good. The merge-back pull request now comes from merge-back/vX.Y.Z, cut at the release branch tip with main's CLI choice put back, so the release's fixes land on main while main keeps following its own choice.
A stable release from main is refused when release/X.Y already has candidates for the very version being cut, so it cannot take the final's version from under it; a patch after a final still goes ahead. A stable release started from a release branch now fails with a reason instead of being skipped silently. The release notes reach the PR body through a file rather than an environment variable, which Linux caps at 128 KB per string; Unreleased is already about 100 KB. The PR body is byte-for-byte the same. create-pull-request truncates a body over 65,536 characters itself, after the checklist.
Start refused a laid-out deployment from another pin only on some paths, so a pinned installer could start over a different release. Start now lays its own pin out again when the installed one differs, and build.rs refuses a manifest whose commit is not the commit being built or whose images are not all pinned by digest.
…nd record the CLI's lockfile The CLI choice now names Node 26 LTS with each platform's published SHA-256, accepts a pkg.pr.new preview only by commit, and build-version.json records the bundled CLI's lockfile hash and dependencies, so an installer's CLI can be identified afterwards.
Main's distribution identity, release manifest, chart and Mac signing meet the shared images and desktop workflows here. images.yml publishes under this repository's own registry namespace and stamps the build identity into every image, and desktop-build.yml compiles that identity in. The release keeps main's rule that published source, chart and manifest never change, and replaces only the installers, which are rebuilt on every run. A pinned build refuses runtime updates. release-policy.json names one release. Create release PR now moves its version along within one release's candidates and final, and a final may not change it beyond the version.
…nd candidate checks
The tag-and-release job restores no Bun cache, like verify, so nothing a less careful branch could have written reaches a published release.
docs/installer-runbook.md is the procedure for making an installer and proving it: an internal build, a release candidate to its final, installing on a clean Mac and Windows PC, checking that an installer is the build meant (its build record, the version and commit in the app, the pinned deployment and its images, the signature), and a checklist for a second person to repeat the result. desktop/scripts/reset-test-machine.sh and .ps1 return a machine to never-installed: OpenBot's containers, volumes and Podman machine, the Intelligence stack it created, the CLI sign-in and the agreement record, ~/OpenBot and the app's data, and optionally the app. Docker, Podman, WSL, other stacks and images stay.
…release Every release attaches each installer under a fixed name as well as its versioned Tauri name (OpenBot-mac-arm64.dmg, OpenBot-mac-x64.dmg, OpenBot-windows-x64-setup.exe), so a web page can link to releases/latest/download/<name> across releases. scripts/release-download-names.ts holds the mapping and fails on an installer it does not know. Publishing a release now dispatches Desktop Windows signing on the tag, as it does Mac signing. After a windows-signing reviewer approves, a separate job attaches the signed -setup.exe under both names with --clobber. On a tag the signed build carries the release version, and the signing job restores no cache. Both signing workflows replace the fixed-name copy along with the versioned one. A re-run of the publish workflow keeps an installer that is already attached and makes the fixed-name copy from those published bytes, so it never puts an unsigned build back over a signed one.
davidmckayv
left a comment
There was a problem hiding this comment.
Comment, not an approval, because this is a draft.
The mechanics hold up. The fixed names can't collide with the updater's assets: latest.json and OpenBot-darwin-*.app.tar.gz keep their versioned releases/download/<tag>/ URLs, and the minisign key (057B5C7E) in tauri.macos-signing.conf.json is untouched. A re-run never puts an unsigned build back over a signed one, and the Windows attach job can't run from a PR. I'd settle two things before marking this ready. There's also one hardening note.
1. The fixed links serve a build macOS blocks for as long as signing waits (publish-release.yml:385, :424, :477)
A stable release is created with --latest, and its ad-hoc installers go up under the fixed names right away, before either signing run is dispatched. From then until a macos-signing reviewer approves and notarization finishes:
latest/download/OpenBot-mac-arm64.dmgserves the ad-hoc build. The header ofdesktop-macos-signing.yml:5-8says macOS refuses that build outright, short of Open Anyway.OpenBot-mac-x64.dmgreturns 404.- The previous release's signed links stop resolving.
So a release merged on a Friday evening breaks the website's Mac download until someone approves. The same window already returns 404 for latest/download/latest.json to installed apps.
One fix covers both: publish a stable release with --latest=false. The signing attach step then promotes it with gh release edit --latest, but only when becomes_latest was true and only after its signed installers are on the release. The Mac attach step already checks the feed as though the release were Latest, so that's the natural place.
2. Signing a candidate replaces its pinned Windows installer with an unpinned one (desktop-signing.yml:131-147, the PR's open question 1)
This PR is the first time a candidate's Windows installer gets replaced at all, so this is new here. desktop-build.yml pins a candidate to its images through OPENBOT_PINNED_DEPLOYMENT, and the signing build never sets it. An unpinned build installs the latest public release's stack (deployment_release.rs:15-38).
So once a reviewer approves signing on v0.3.0-rc.1, the release's OpenBot_0.3.0-rc.1_x64-setup.exe installs v0.2.0's images. Testers then sign off on a candidate whose images they never ran.
I'd fix it in this PR:
- On a prerelease tag, download the release's
container-images.jsonand exportOPENBOT_PINNED_DEPLOYMENTbeforetauri build.build.rsalready checks that the manifest's commit matches. - Bundle the CLI the way
desktop-build.ymldoes, so the signed build doesn't drop it oncetauri.bundled-cli.conf.jsonlands.
The Mac side of this is in #980 and needs the same change.
3. From an untrusted ref, reviewer approval is the only gate (not blocking)
What I verified:
- The sign job runs in
windows-signing(desktop-signing.yml:66), which has five required reviewers. - Fork PRs are excluded (
:65). - The attach job runs only on dispatch (
:188) and refuses any ref other thanrefs/tags/<release-tag>(:214).
What isn't covered: windows-signing has no deployment branch or tag policy, the repo has no ruleset on v* tags, and prevent-self-review is off. So a writer could move a release tag to another commit and dispatch a re-sign. Both checks would pass, because the ref is the tag and the version comes from that commit's package.json. One approval would then attach a different commit under the release's version.
Two cheap hardenings:
- In both attach steps, compare
$GITHUB_SHAwithsource.commitin the release's ownrelease-manifest.json. - Restrict the environment to selected refs:
v*tags, plusrefs/pull/*/mergeif PR-label signing stays. GitHub matches these rules against the run'sGITHUB_REF(docs).
Running the ref check before sign would also stop a mis-dispatched run before it asks anyone to approve.
Nit: publish-release.yml:288 still says actions: write is only for Mac signing.
…atest only once it is signed Signing a candidate built an unpinned app and attached it over the pinned candidate installer under the same name, so Mac testers installed the latest public release instead of the candidate. The signing run then failed its update-feed check, because a prerelease is never Latest. - desktop/scripts/signed-build.ts builds the signed app the way desktop-build.yml builds the ad-hoc one: a candidate or beta is pinned to its release's container-images.json and carries no updater (no plugins.updater, no updater archive, and the updater key is kept out of its build), and the CLI is bundled whenever the tree has the overlay for it. Desktop macOS signing builds through it. intelligence-cli.json pins Node's darwin-x64 hash for the signed Intel build. - A stable release is published not Latest. desktop/scripts/publish-signed-mac.sh attaches the signed installers, then marks the release Latest when verify decided it becomes Latest and no newer release has become Latest since, then checks the update feed. A candidate attaches its pinned .dmg files only, and a release that is not Latest skips the feed check. scripts/release-becomes-latest.sh holds the rule both places use. - A re-run of the publish workflow keeps installers already on the release (scripts/release-attach-installers.sh), so it never puts the ad-hoc .dmg back over a signed one, and it no longer touches Latest. - Release installers are built without the Rust and Bun caches, and the comments that said signing was still to come are updated. The new tests run the scripts against a stand-in gh and curl (scripts/release-fakes.ts), and check that the workflows call them. Updater regressions (no Apple access) runs them on macOS.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
#980 moved the release's installer handling into scripts: release-attach-installers.sh for the publish re-run, publish-signed-mac.sh for the Mac attach and Latest, and signed-build.ts, which pins a signed candidate to its release's images. This branch's fixed download names and Windows signing now go through them instead of inline workflow shell: - scripts/release-download-names.sh replaces the TypeScript mapping, so the shell scripts call it without bun. - release-attach-installers.sh attaches each installer's fixed-name copy from the bytes on the release, and replaces a copy that is missing or differs. - publish-signed-mac.sh uploads the fixed names with the signed .dmg files, before the release can become Latest. - Desktop Windows signing builds through signed-build.ts, so a signed candidate is pinned like the unsigned one, and attaches through the new publish-signed-windows.sh. It never moves Latest.
|
My review's points, checked against this branch:
One gap remains by design: once Mac signing marks a release Latest, the Windows fixed link serves the unsigned installer until Windows signing is approved. Still needs a real release: approved Mac and Windows signing runs on a candidate tag and on a stable tag. |
# Conflicts: # .github/workflows/desktop-macos-signing.yml # .github/workflows/publish-release.yml # desktop/scripts/publish-signed-mac.sh # desktop/scripts/publish-signed-mac.test.ts # docs/installer-runbook.md # docs/releasing.md # scripts/release-attach-installers.sh # scripts/release-latest.test.ts
…s are on it Mac signing marked a stable release Latest as soon as its own installers were attached, so until Windows signing was approved, releases/latest/download/OpenBot-windows-x64-setup.exe served the unsigned installer, and the previous release's signed one stopped being reachable there. - On a stable release the publish workflow now attaches the unsigned installers under their versioned names only. The fixed download names come from the signing runs, from the signed installers, so a fixed name on a stable release means its installer is signed. Candidates and betas still get both names at publish. - scripts/release-make-latest.sh marks the release Latest once latest.json and every fixed name (release-download-names.sh --all) are on it, re-checking that no newer release is Latest, and then checks the update feed. Both attach jobs call it after attaching, so whichever signing run finishes second makes the release Latest. publish-release.yml hands the decision to Windows signing as make-latest, the same as to Mac signing. The tests run both orders against the stand-in gh, which now tracks the release's assets, and check the workflow wiring; signing-workflows.test.ts runs in Signing regressions (no Azure access) as well as Updater regressions (no Apple access). They fail on 0c6f41b and pass now.
|
Pushed to this branch:
Still needs a real release: approved Mac and Windows signing runs on a stable tag, in either order. |
Each attach job ends by asking whether every signed installer is on the release, and makes it Latest when they are. If both ran at once, each could look before the other had uploaded, and the release would stay not Latest. Both publish jobs now share the concurrency group release-attach-<tag>, without cancelling a running one, so the second always sees what the first attached. signing-workflows.test.ts fails if either workflow loses the group.
Brings in fixed-name release installers and Windows signing on release (#1020), and the self-hosted Helm chart (#1019). The Windows signing job now builds through signed-build.ts from main; the installer check for the bundled CLI stays, and the Mac signing checks keep running release-cli-bundle.test.ts. CHANGELOG keeps the corrected sign-in line.
Stacked on #980. The base is
dustywusty/internal-builds-and-rcs. Once #980 merges, this will be retargeted tomain.What this does
Whenever OpenBot releases a version, the GitHub Release carries installers for every platform, and a website can link to them at addresses that never change.
1. Fixed download names
Tauri puts the version in each installer's name (
OpenBot_0.3.0_aarch64.dmg), so areleases/latest/download/<name>link broke with every release. Each installer is now also attached under a fixed name:https://github.com/CopilotKit/OpenBot/releases/latest/download/OpenBot-mac-arm64.dmghttps://github.com/CopilotKit/OpenBot/releases/latest/download/OpenBot-mac-x64.dmghttps://github.com/CopilotKit/OpenBot/releases/latest/download/OpenBot-windows-x64-setup.exescripts/release-download-names.sh(with tests) maps Tauri names to fixed names. It fails on an installer it does not know, so a new platform or a product rename is caught instead of being published without a stable link. It is bash, so the publish jobs need no bun.scripts/release-attach-installers.sh, which the publish workflow calls, attaches each installer's fixed-name copy too.desktop/scripts/publish-signed-mac.shuploads the fixed names in the same upload as the signed.dmgfiles, before the release can become Latest.2. Windows signing on release
publish-release.ymldispatchesdesktop-signing.ymlon the tag withsigning-mode=keyvaultandrelease-tag=<version>, the same way it starts Mac signing. Thewindows-signingreviewers still approve. The environment has no branch or tag restriction, so a dispatch on a tag reaches them.desktop-signing.yml:release-taginput;desktop/scripts/signed-build.ts(win32 x64,--bundles nsis), so a signed candidate is pinned to its release's images like the unsigned one, and the CLI is bundled whenever the tree can bundle one. On a branch or PR it is the same internal build as before.publishjob on ubuntu withcontents: writerunsdesktop/scripts/publish-signed-windows.sh(with tests). It refuses a build whose version is not the tag's, or that is pinned to another release. Otherwise it attaches the signed-setup.exeunder both names in one upload with--clobber. The signing job never holds a write token.Docs
docs/releasing.md: a new Download links section. It also says that a release is cut only by merging the release PR, and that av*tag pushed by hand only starts Mac signing. Windows signing is added to "What merging does" and to the candidates section.docs/installer-runbook.md: lists the fixed addresses, adds the Windows approval to step 5, and adds new troubleshooting rows.docs/windows-signing.md: a new Sign a release section.Re-run reasoning
I could not run the release workflows for real. The scripts are tested against #980's fake
gh(scripts/release-fakes.ts). The tests read back the bytes each upload would attach, so they show which build a fixed-name copy came from.--clobber, so a re-run converges on the newly signed build. For Windows, the sign job outputs the artifact name of the attempt that signed, so a re-run of only the failed attach job picks up that attempt's installer.Open questions and follow-ups
latest/download/OpenBot-windows-x64-setup.exeserves the new release's unsigned installer in between. The docs say to approve both. Alternatives would be to make Latest wait for both signings, or to have the publish workflow not attach the unsigned Windows build under the fixed name. Tell me if you want either.publishjob downloadsopenbot-macos-signed-*withmerge-multiple. After a full re-run ofsign, artifacts from both attempts match, and same-named files overwrite each other in an unspecified order.latest.jsoncould then pair one attempt's.app.tar.gzwith the other attempt's.sig. The fix is the per-attempt artifact output that Windows uses here. It is out of scope.OpenBot-mac-arm64.dmg,OpenBot-mac-x64.dmg,OpenBot-windows-x64-setup.exe. Once a website links to them they are permanent, so change them before merging if you want different ones.Merging #980's latest commits
publish-release.ymlanddesktop-macos-signing.ymlwas dropped in favour of Internal builds and release candidates #980's scripts, with the fixed-name logic moved into them.scripts/release-download-names.sh.refs/tags/<release-tag>was dropped.publish-signed-mac.shalready refuses a build whose version is not the tag's, and a candidate pinned to another release, which covers the same mistake.signed-build.ts, which Windows now uses too.Checks
actionlint .github/workflows/*.yml: only the known$/.github/workflows/...reusable-path false positives.uvx zizmor --config .github/zizmor.yml .github/workflows/: 0 high, 0 medium, 0 low. The single informational finding is the existing one inimages.yml.shellcheckon the four release shell scripts: clean.bun run format:check,bun run lint: clean.bun test scripts/: 0 fail. Signed release regressions (signed-build,publish-signed-mac,publish-signed-windows,release-latest,release-download-names): 43 pass. The new tests are also added to the Signed release regressions step in Desktop macOS signing.