From fefbfa623f880e9c71c08888cb7c418bf30ba2b8 Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Sun, 11 Oct 2026 14:38:30 -0400 Subject: [PATCH 1/3] feat(release): J5 versions are dates, and a stable release is a promoted nightly J5's 0.0.x numbers looked like upstream's and were read as upstream's. A version is now ..: the UTC day of the build and a counter for that day's stable releases. J5 Nightly names its build for the day it runs, and the new J5 Stable workflow promotes a published nightly's commit to the same version without the nightly suffix. Nothing is committed for either, so the version bump after a release goes away. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/j5-ci.yml | 5 +- .github/workflows/j5-nightly.yml | 31 +++---- .github/workflows/j5-release.yml | 39 +++++---- .github/workflows/j5-stable.yml | 122 ++++++++++++++++++++++++++++ FORK.md | 4 +- docs/j5/runbooks/macos-packaging.md | 83 +++++++++++-------- scripts/j5/release-version.test.ts | 73 +++++++++++++++++ scripts/j5/release-version.ts | 87 ++++++++++++++++++++ 8 files changed, 374 insertions(+), 70 deletions(-) create mode 100644 .github/workflows/j5-stable.yml create mode 100644 scripts/j5/release-version.test.ts create mode 100644 scripts/j5/release-version.ts diff --git a/.github/workflows/j5-ci.yml b/.github/workflows/j5-ci.yml index 1e6f112af7fbe..b292052f45b12 100644 --- a/.github/workflows/j5-ci.yml +++ b/.github/workflows/j5-ci.yml @@ -1,8 +1,8 @@ name: J5 CI # Pull request branches are covered by `pull_request`, so `push` lists only the -# branches that are tested without a PR: `j5/main`, and the release and preview -# branches the packaging runbook publishes from before any PR exists. +# branches that are tested without a PR: `j5/main`, and the preview branches +# the packaging runbook publishes from before any PR exists. # `pull_request` has no base filter, so every layer of a chain of PRs is tested # whatever its base branch is named, and whether or not GitHub knows the chain # as a stack. @@ -10,7 +10,6 @@ on: push: branches: - "j5/main" - - "j5/release-[0-9]*" - "j5/preview-[0-9]*" pull_request: diff --git a/.github/workflows/j5-nightly.yml b/.github/workflows/j5-nightly.yml index e2329a9699b94..e9be13304ca81 100644 --- a/.github/workflows/j5-nightly.yml +++ b/.github/workflows/j5-nightly.yml @@ -1,10 +1,11 @@ name: J5 Nightly # Publishes a nightly of `j5/main`: a pre-release tagged -# `v-nightly..`, where `x.y.z` is the next patch after the -# version the manifests commit. Servers on the nightly channel and desktop apps -# on the nightly update track follow it. Nothing is committed: the version is -# stamped into the manifests during each build. +# `v..-nightly..`, named for the UTC day it is built +# (scripts/j5/release-version.ts). Servers on the nightly channel and desktop +# apps on the nightly update track follow it. Nothing is committed: the version +# is stamped into the manifests during each build. J5 Stable promotes a nightly +# to a stable release. # # Started by hand for now. To run it on a schedule, add a `schedule` trigger and # set `due` in the `resolve` job from `shouldReleaseNightly` in upstream's @@ -42,30 +43,24 @@ jobs: - uses: actions/checkout@v6 - - uses: pnpm/action-setup@v6 - with: - version: 12.14.0 - run_install: false - - uses: actions/setup-node@v6 with: node-version-file: .nvmrc - cache: pnpm - - - run: pnpm install --frozen-lockfile - # Upstream's script; its `name` output says "T3 Code" and is not used. + # The stable releases already tagged for today decide the nightly's number. - name: Resolve the nightly version id: version env: + GH_TOKEN: ${{ github.token }} NIGHTLY_DATE: ${{ github.run_started_at }} run: | set -euo pipefail - pnpm exec node scripts/resolve-nightly-release.ts \ - --date "$(date -u -d "$NIGHTLY_DATE" +%Y%m%d)" \ - --run-number "$GITHUB_RUN_NUMBER" \ - --sha "$GITHUB_SHA" \ - --github-output + date="$(date -u -d "$NIGHTLY_DATE" +%Y%m%d)" + gh api --paginate "repos/$GITHUB_REPOSITORY/git/matching-refs/tags/v${date:0:6}.$((10#${date:6}))." \ + --jq '.[].ref | sub("^refs/tags/"; "")' > "$RUNNER_TEMP/tags.txt" + version="$(node scripts/j5/release-version.ts nightly \ + --date "$date" --run-number "$GITHUB_RUN_NUMBER" --tags-file "$RUNNER_TEMP/tags.txt")" + echo "version=$version" >> "$GITHUB_OUTPUT" - name: Decide whether a nightly is due id: due diff --git a/.github/workflows/j5-release.yml b/.github/workflows/j5-release.yml index 7634c99d53e82..bfdd75adb8b18 100644 --- a/.github/workflows/j5-release.yml +++ b/.github/workflows/j5-release.yml @@ -26,10 +26,12 @@ name: J5 Release # A version `-nightly..` publishes a nightly: also a # pre-release that never becomes "latest", but with `nightly-mac.yml`, the feed # desktop apps on the nightly update track follow. Nightlies come only from J5 -# Nightly, which calls this workflow with a commit and a version; a manual run -# refuses a nightly version, and a call refuses any other. The version is -# then stamped into the manifests at build time instead of being read from them, -# and the desktop app is built by this run's `desktop` job. +# Nightly, and stable releases only from J5 Stable, which promotes a nightly. +# Both call this workflow with a commit and a date version +# (scripts/j5/release-version.ts); the version is then stamped into the +# manifests at build time instead of being read from them, and the desktop app +# is built by this run's `desktop` job. A manual run publishes only a preview, +# at the version its branch commits. # # The builds run side by side and only `release` waits for all of them. Each # macOS job is one more wait for a scarce macOS runner, so there are two: @@ -139,15 +141,20 @@ jobs: if (channel === null) { throw new Error(`This workflow requires a stable (x.y.z), preview (x.y.z-preview..) or nightly (x.y.z-nightly..) version; found ${version}.`); } - // A nightly reaches every install on the nightly track, so it comes only from J5 - // Nightly, which builds j5/main. A manual run never publishes one, whatever version - // the branch commits. - if (!stamp && channel === 'nightly') { - throw new Error(`Nightlies are published by J5 Nightly, not by a manual J5 Release; found ${version}.`); + // A nightly reaches every install on the nightly track and a stable release every + // install, so they come only from J5 Nightly, which builds j5/main, and J5 Stable, + // which promotes a nightly. A manual run never publishes one, whatever version the + // branch commits. + if (!stamp && channel !== 'preview') { + throw new Error(`A manual J5 Release publishes only a preview; nightlies come from J5 Nightly and stable releases from J5 Stable. Found ${version}.`); } - // Nothing calls this workflow with a stable or preview version until promotion exists. - if (stamp && channel !== 'nightly') { - throw new Error(`A calling workflow can publish only a nightly; found ${version}.`); + if (stamp && channel === 'preview') { + throw new Error(`A calling workflow publishes a nightly or a stable release; found ${version}.`); + } + // Nightly and stable versions are dates (scripts/j5/release-version.ts). Anything + // else would sort below every date version and never be offered as an update. + if (stamp && !/^\d{6}\.([1-9]|[12]\d|3[01])\.\d+(-|$)/.test(version)) { + throw new Error(`A nightly or stable version is ..; found ${version}.`); } // Release archives replace the npm package from 0.0.44 on; an older // version number would be offered as a downgrade to every installed @@ -159,8 +166,10 @@ jobs: // A published release that already carries SHA256SUMS is final: // rebuilding would change archive bytes under existing checksums. // An existing release for this version must come from the same - // commit; a mismatch means the version was not bumped, so fail - // rather than report "already published". + // commit. A mismatch means a preview's version was not bumped, or + // a nightly whose number another nightly already took as a stable + // release is being promoted, so fail rather than report "already + // published". const tag = `v${version}`; let published = false; let release = null; @@ -179,7 +188,7 @@ jobs: if (error.status !== 404 && error.status !== 422) throw error; } if (tagSha !== null && tagSha !== sha) { - throw new Error(`Release ${tag} already exists at ${tagSha}, but this build is ${sha}. Bump the version before releasing.`); + throw new Error(`Release ${tag} already exists at ${tagSha}, but this build is ${sha}. ${channel === 'stable' ? 'Promote a newer nightly.' : 'Bump the version before releasing.'}`); } published = tagSha === sha && !release.draft && release.assets.some(asset => asset.name === 'SHA256SUMS'); } diff --git a/.github/workflows/j5-stable.yml b/.github/workflows/j5-stable.yml new file mode 100644 index 0000000000000..04efedba3937b --- /dev/null +++ b/.github/workflows/j5-stable.yml @@ -0,0 +1,122 @@ +name: J5 Stable + +# Promotes a published nightly to a stable release: the nightly's commit, built +# again as `..` (the nightly's version without its suffix) and +# published as "latest". The stable build is of a commit nightly users already +# ran. Nothing is committed: the version is stamped into the manifests during +# each build. + +on: + workflow_dispatch: + inputs: + nightly: + description: Nightly to promote, such as v202610.15.0-nightly.20261015.12. Defaults to the newest. + required: false + type: string + +permissions: {} + +concurrency: + group: j5-stable + cancel-in-progress: false + +jobs: + resolve: + name: Resolve the nightly and its stable version + if: github.repository == 'Jacksondr5/j5code' + runs-on: ubuntu-24.04 + timeout-minutes: 10 + permissions: + contents: read + outputs: + ref: ${{ steps.version.outputs.ref }} + version: ${{ steps.version.outputs.version }} + steps: + - name: Require the default branch + run: | + if [[ "$GITHUB_REF" != "refs/heads/j5/main" ]]; then + echo "::error::Run J5 Stable on j5/main, whose workflows it uses; this run was started on $GITHUB_REF." + exit 1 + fi + + - uses: actions/checkout@v6 + + - uses: actions/setup-node@v6 + with: + node-version-file: .nvmrc + + - name: Resolve the nightly and its stable version + id: version + env: + GH_TOKEN: ${{ github.token }} + NIGHTLY: ${{ inputs.nightly }} + run: | + set -euo pipefail + tag="$NIGHTLY" + if [[ -z "$tag" ]]; then + tag="$(gh api "repos/$GITHUB_REPOSITORY/releases?per_page=100" \ + --jq '[.[] | select(.draft | not) | select(.tag_name | test("-nightly\\."))] | sort_by(.published_at) | last | .tag_name // empty')" + if [[ -z "$tag" ]]; then + echo "::error::No published nightly found. Run J5 Nightly first." + exit 1 + fi + fi + tag="v${tag#v}" + # A nightly that was never published was never offered to anyone to run. + if [[ "$(gh api "repos/$GITHUB_REPOSITORY/releases/tags/$tag" --jq '.draft')" != "false" ]]; then + echo "::error::$tag is not a published release." + exit 1 + fi + latest="$(gh api "repos/$GITHUB_REPOSITORY/releases/latest" --jq '.tag_name')" + version="$(node scripts/j5/release-version.ts stable "$tag" --latest "$latest")" + ref="$(gh api "repos/$GITHUB_REPOSITORY/commits/$tag" --jq '.sha')" + echo "version=$version" >> "$GITHUB_OUTPUT" + echo "ref=$ref" >> "$GITHUB_OUTPUT" + echo "::notice::Promoting $tag ($ref) to J5 Code $version." + + # These gitlinks belong to vendored manifests, not this repository. + # Remove them only from the disposable index before checkout's cleanup. + - name: Exclude vendored gitlinks from checkout cleanup + if: always() + run: | + python3 - <<'PYTHON' + import subprocess + entries = subprocess.check_output(["git", "ls-files", "--stage", "-z", ".repos"]) + paths = [entry.split(b"\t", 1)[1] for entry in entries.split(b"\0") if entry.startswith(b"160000 ")] + if paths: + subprocess.run(["git", "update-index", "--force-remove", "-z", "--stdin"], input=b"\0".join(paths) + b"\0", check=True) + PYTHON + + build: + name: Desktop build + needs: resolve + permissions: + contents: read + uses: ./.github/workflows/j5-macos-build.yml + with: + ref: ${{ needs.resolve.outputs.ref }} + version: ${{ needs.resolve.outputs.version }} + secrets: + CSC_LINK: ${{ secrets.CSC_LINK }} + CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} + APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} + APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} + APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} + + # Builds the CLI archives and publishes them with the desktop build above. + release: + name: Release + needs: [resolve, build] + permissions: + contents: write + actions: read + uses: ./.github/workflows/j5-release.yml + with: + ref: ${{ needs.resolve.outputs.ref }} + version: ${{ needs.resolve.outputs.version }} + secrets: + CSC_LINK: ${{ secrets.CSC_LINK }} + CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} + APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} + APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} + APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} diff --git a/FORK.md b/FORK.md index 5072a20a2d4e3..64079155ad91c 100644 --- a/FORK.md +++ b/FORK.md @@ -572,7 +572,7 @@ Current pin: `322f6544dfad0a3c8a0c8cbecf2c7f7874b14268`, upstream's stable relea Released pin: `70d60e03a7a35c6fa131825bbfa05ec893e69912`, from `main` (in J5 Code 0.0.51, frozen 2026-10-17). -The released pin is the one the latest stable release is built on, and it is what j5.codes shows. It changes in the pull request that brings a stable release's version bump into `j5/main`, never in the advance itself. +The released pin is the one the latest stable release is built on, and it is what j5.codes shows. It changes in a pull request after `J5 Stable` publishes a stable release, never in the advance itself. Since the 2026-10-08 pin, `j5/main` descends from upstream `main`, which upstream does not rewrite, so an advance is an ordinary merge; the 2026-10-17, 2026-10-24 and 2026-11-07 advances were. The 2026-09-24 pin (`67a2be0fdb`) is not an ancestor of the 2026-10-08 one, because upstream merged V2 into `main` as a squash (pingdotgg/t3code#2829). @@ -626,7 +626,7 @@ The Muse and Kiro replay fixtures carry two D25 substitutions. The Muse replay c ## J5 CI and packaging Fork-owned workflows use the Node version in `.nvmrc` (26.12.1 since the 2026-10-24 advance, the exact version upstream's `engines` names; upstream removed its own `.nvmrc` then, and J5 keeps one for its workflows and `fnm`), pnpm `12.14.0`, the frozen pnpm lockfile, and -the repo-local Vite Plus binary. `J5 CI` is the gate for every PR, whatever its base branch, and for pushes to `j5/main` and the release and preview branches; `J5 Weekly Full Build` is the +the repo-local Vite Plus binary. `J5 CI` is the gate for every PR, whatever its base branch, and for pushes to `j5/main` and the preview branches; `J5 Nightly` publishes `j5/main` and `J5 Stable` promotes a nightly, both under J5's date versions (`scripts/j5/release-version.ts`), so upstream's `scripts/resolve-nightly-release.ts` is not used; `J5 Weekly Full Build` is the scheduled and manually dispatchable pre-rebase suite plus Apple Silicon desktop build. `J5 CI` runs the web suite on its own runner (`Test Web`), as upstream's `test_web` does, and installs headless Chromium in the server shards for upstream's preview browser tests; `J5 Weekly Full Build` installs it before its one full run. Upstream's vendored tree under `.repos` carries two gitlinks with no `.gitmodules`, which make `actions/checkout`'s credential cleanup fail; every J5 job that checks out the repository drops them from its disposable index in a last step, and no J5 checkout sets `persist-credentials: false`, because that runs the cleanup inside the checkout step. In `J5 Release` that leaves the token in the checkout until the job ends: the one job with a write token (`release`) runs no repository code, and the jobs that install and build hold a read-only token. `J5 Mobile CI` runs upstream's mobile native static analysis and an iOS simulator Debug build on macOS, each only when its native inputs change; both are advisory and outside the required check. `J5 Release` publishes CLI archives (darwin-arm64, linux-x64), SHA256SUMS, install.sh and the signed desktop build to GitHub Releases (case 40), as the latest release for a stable version and as a pre-release that is never latest for a `-preview..` or `-nightly..` version (procedure in `docs/j5/runbooks/macos-packaging.md`); npm publishing is retired. `J5 Nightly` (manual dispatch on `j5/main`; issue #507) resolves the next nightly version with upstream's `scripts/resolve-nightly-release.ts` and calls `J5 Signed macOS Build` and `J5 Release` with that commit and version. Called that way, both stamp the version with upstream's `scripts/update-release-package-versions.ts` during the build instead of reading committed manifests, the app is checked as `J5 Code (Nightly).app`, and the release must carry `nightly-mac.yml` and no `latest-mac.yml`. Run by hand, both behave as before. No upstream script or workflow is edited for this. It has no schedule yet; upstream's `.github/scripts/check-nightly-release.cjs` is the gate to add with one. Promoting a nightly's commit to stable is not built. The CLI archive job runs the database startup tests and the one-owner lock test (`apps/server/src/serverRuntimeState.test.ts`) on the Node the executable embeds, 26.12.1, which upstream's build now takes from `engines` in place of a pinned `SEA_NODE_VERSION`; it is `.nvmrc`'s version too since the 2026-10-24 advance. The job sets up that Node around `build-exe` (Node single-executables need `--build-sea`), runs every repo script through `pnpm exec` so the repo-local `vp` is on PATH, and applies production web icons before packing. Upstream's workflows stay in the tree behind `github.repository == 'pingdotgg/t3code'`, so they neither run nor publish from the fork. J5 adds the guard to every job in `ci.yml`, combined inside one `${{ }}` with upstream's `!cancelled()` condition where a job has one (on the aggregate `check` job as `always() && …`, so it is skipped on the fork instead of failing), on `mobile-eas-preview.yml` (beside upstream's own same-repository condition), `mobile-fingerprint-check.yml`, `thread-transfer-report.yml`, `stale-needs-more-info.yml`, `agent-context-budget.yml` (case 110), `mobile-eas-preview-fork.yml` and `mobile-fingerprint-label.yml`, on `resolve` and `cleanup` in `desktop-macos-preview-publish.yml`, on `deploy_preview` in `relay-preview.yml` and on all three jobs of `relay-preview-cleanup.yml`, and on every job in `issue-labels.yml`, `web-preview.yml`, `desktop-macos-preview.yml`, `mobile-showcase-screenshots.yml` and `windows-tests.yml`. Upstream carries the same guard itself, so those files equal upstream's, on `deploy_relay` in `deploy-relay.yml`, the `mirror` job of `mobile-android-apk.yml`, `production` in `mobile-eas-production.yml`, the `publish` job in `publish-aur.yml` and `resolve_commit` in `release.yml`; the other jobs of `release.yml` and `desktop-macos-preview-publish.yml` depend on the guarded ones. `release-desktop.yml` and `publish-aur.yml` are `workflow_call` only and are reached through `release.yml`. diff --git a/docs/j5/runbooks/macos-packaging.md b/docs/j5/runbooks/macos-packaging.md index cc79864773598..9397dd0e46f55 100644 --- a/docs/j5/runbooks/macos-packaging.md +++ b/docs/j5/runbooks/macos-packaging.md @@ -69,28 +69,49 @@ T3 Code. ## GitHub Actions -For a public release: +### Version numbers -1. Bump the release versions with `node scripts/update-release-package-versions.ts `. It - writes the same version into `apps/server`, `apps/desktop`, `apps/web`, and `packages/contracts` - `package.json`. Commit the change and push it as `j5/release-`. -2. Run `J5 Signed macOS Build` on that branch. Keep the branch at the same commit until publication: - GitHub restricts release creation with the standard Actions token when the target commit is no - longer a branch head or tag. -3. After CI and the signed build pass, run `J5 Release` with that build's numeric run ID. -4. After publication, bring the version bump into `j5/main` with a PR so `j5/main` never reports an - older version than the latest release. -5. In that PR, update the `Released pin:` line in `FORK.md` to the release's version and the - upstream pin, branch and frozen date it was built on. j5.codes reads that line. +A J5 version is a date: `..`, the UTC day the build was made and a counter for that +day's stable releases. `202610.15.0` is the first stable release of 15 October 2026 and +`202610.15.1` a second one that day. Month and day carry no leading zero beyond the month's own +(`202701.5.0`), because version numbers may not. A nightly is +`..-nightly..`, where `n` is the next number no stable release of that +day has taken, so it sorts above every stable release that exists and below the one promoted from +it. `scripts/j5/release-version.ts` computes both. The numbers say nothing about upstream: the +T3 Code release J5 is built on is `J5_UPSTREAM_T3_CODE_VERSION` (FORK.md case 59). + +Releases through 0.0.48, and nightlies named `0.0.49-nightly.*`, predate this. Every date version +sorts above them. + +Nothing is committed for a nightly or a stable release: the version is stamped into the four +manifests (`apps/server`, `apps/desktop`, `apps/web`, `packages/contracts`) during the build. The +version those manifests commit is what a development build reports and is not a release number. + +### Stable + +A stable release is a nightly, promoted: the same commit, built again under the nightly's version +without its suffix, and published as latest. + +1. Use the nightly in real work until you trust it. +2. Run `J5 Stable` on `j5/main`. With no input it promotes the newest nightly; to promote another, + give its tag, such as `v202610.15.0-nightly.20261015.12`. +3. After publication, update the `Released pin:` line in `FORK.md` to the release's version and the + upstream pin, branch and frozen date it was built on, in a PR. j5.codes reads that line. + +`J5 Stable` refuses a nightly older than the current stable release. It also refuses a nightly +whose number an earlier promotion already took: two nightlies built the same day before any stable +release share a number, and only one of them can become it. Promote a newer nightly. For a preview, to test installs and updates from a branch before it merges: 1. On a branch cut from the work under test, run - `node scripts/update-release-package-versions.ts -preview..`, using the next - release's `x.y.z`, today's date, and a counter that starts at 1. Commit and push it as - `j5/preview--`. This branch is never merged. -2. Run `J5 Signed macOS Build` on that branch, then `J5 Release` with that build's run ID, as for a - public release. Keep the branch at that commit until the release is published. + `node scripts/update-release-package-versions.ts -preview..`, using today's + date version as `x.y.z` (`202610.15.0`), today's date, and a counter that starts at 1. Commit + and push it as `j5/preview--`. This branch is never merged. +2. Run `J5 Signed macOS Build` on that branch. After CI and the signed build pass, run `J5 Release` + with that build's numeric run ID. Keep the branch at that commit until the release is published: + GitHub restricts release creation with the standard Actions token when the target commit is no + longer a branch head or tag. 3. Install it by naming the version; nothing offers a preview on its own: - **Fresh server:** use the installer attached to that release, which is the one under test: `curl -fsSL https://github.com/Jacksondr5/j5code/releases/download/v/install.sh | T3CODE_VERSION= sh`. @@ -110,12 +131,10 @@ A preview is a GitHub pre-release and is never marked latest. The stable install ### Nightly -A nightly is `j5/main` as it stands, published for daily use ahead of a stable release. Nothing is -committed for one: the version is stamped into the four manifests during the build. +A nightly is `j5/main` as it stands, published for daily use ahead of a stable release. -To publish one, run `J5 Nightly` on `j5/main`. It takes no inputs. It names the build -`-nightly..`, where `x.y.z` is the next patch after the version `j5/main` -commits, then runs the signed macOS build and the release for that commit. The result is a GitHub +To publish one, run `J5 Nightly` on `j5/main`. It takes no inputs. It names the build for the day +it runs (see Version numbers), then runs the signed macOS build and the release for that commit. The result is a GitHub pre-release, never marked latest, tagged `v`. If the release job fails, re-run the failed job in that run: it reuses the draft release the first @@ -222,13 +241,13 @@ the time to repeat step 2. one tests run on, so the run also runs the database startup tests on that Node, on Linux and macOS; - `install.sh`, `install.ps1`, and `SHA256SUMS` over the archives and both installers. -Run by hand with a build's run ID, its resolve job reads the version from the build commit's four -manifests, which must agree. Called by `J5 Nightly`, it is given the commit and the version, stamps -the version before building the CLI archives, and publishes the desktop build made earlier in the -same run. A run by hand publishes only a stable or preview version and refuses a nightly one, -whatever the branch commits: a nightly comes only from `J5 Nightly`, and a call publishes nothing -else. The version must be at least 0.0.44 (0.0.43 and earlier were npm releases). If a release for that -version already exists at a different commit, the run fails: bump the version and build again. If +Called by `J5 Nightly` or `J5 Stable`, it is given the commit and the version, stamps the version +before building the CLI archives, and publishes the desktop build made earlier in the same run. It +accepts only a date version from a caller. Run by hand with a build's run ID, its resolve job reads +the version from the build commit's four manifests, which must agree, and publishes only a preview: +a nightly comes only from `J5 Nightly` and a stable release only from `J5 Stable`, whatever the +branch commits. If a release for that version already exists at a different commit, the run fails: +bump a preview's version and build again, or promote a newer nightly. If it is already published from the same commit with `SHA256SUMS` attached, the run does nothing. The workflow uses GitHub-hosted runners and does not deploy relay or Vercel services. @@ -243,8 +262,8 @@ link beside it so a server from before the rename can run the update check that signs with Developer ID, and notarizes the app. It verifies the mounted app's identity (J5 Code, or J5 Code (Nightly) for a nightly version), signature, notarization ticket, and Gatekeeper assessment before uploading artifacts for 30 days. It does not create a GitHub Release. Run by hand it builds -the branch it was started on at the version that branch commits; `J5 Nightly` calls it with a -commit and a version to stamp. The workflow uses the Apple signing secrets and +the branch it was started on at the version that branch commits; `J5 Nightly` and `J5 Stable` call +it with a commit and a version to stamp. The workflow uses the Apple signing secrets and `APPLE_TEAM_ID` repository variable; it converts the P12 export to a Keychain-compatible format. Clerk passkey provisioning is only required when Clerk/passkey configuration is supplied. @@ -257,7 +276,7 @@ Signing account; upstream's `release-desktop.yml` shows the secrets and the `--s turn it on. - `J5 CI` runs formatting, lint, typecheck, and unit-test gates on every PR, and on - pushes to `j5/main`, `j5/release-`, and `j5/preview--`. + pushes to `j5/main` and `j5/preview--`. - `J5 Weekly Full Build` runs Mondays at 08:23 UTC and on manual dispatch. It runs the full suite, full build, produces the ad-hoc signed Apple Silicon DMG/ZIP, verifies the mounted app, and uploads the artifacts for 30 days. diff --git a/scripts/j5/release-version.test.ts b/scripts/j5/release-version.test.ts new file mode 100644 index 0000000000000..9e78ece842eee --- /dev/null +++ b/scripts/j5/release-version.test.ts @@ -0,0 +1,73 @@ +import { compareSemverVersions } from "@t3tools/shared/semver"; +import { describe, expect, it } from "vite-plus/test"; + +import { nightlyVersion, stableVersionOf } from "./release-version.ts"; + +describe("J5 date versions", () => { + it("names a nightly for its UTC build day, without leading zeros", () => { + expect(nightlyVersion({ date: "20261015", runNumber: 12, tags: [] })).toBe( + "202610.15.0-nightly.20261015.12", + ); + expect(nightlyVersion({ date: "20270105", runNumber: 40, tags: [] })).toBe( + "202701.5.0-nightly.20270105.40", + ); + }); + + it("takes the next number after that day's stable releases, ignoring other days and nightlies", () => { + const tags = [ + "v202610.14.3", + "v202610.15.0", + "v202610.15.1", + "v202610.15.0-nightly.20261015.12", + "v202610.15.7-preview.20261015.1", + "v0.0.48", + "", + ]; + expect(nightlyVersion({ date: "20261015", runNumber: 13, tags })).toBe( + "202610.15.2-nightly.20261015.13", + ); + expect(nightlyVersion({ date: "20261016", runNumber: 14, tags })).toBe( + "202610.16.0-nightly.20261016.14", + ); + }); + + it("promotes a nightly to the stable version of its own day and number", () => { + expect(stableVersionOf("v202610.15.2-nightly.20261015.13")).toBe("202610.15.2"); + expect(() => stableVersionOf("0.0.49-nightly.20261010.3")).toThrow( + /Expected a nightly version/, + ); + expect(() => stableVersionOf("202610.15.0")).toThrow(/Expected a nightly version/); + }); + + it("refuses to promote a nightly from before the current stable release", () => { + const nightly = "v202610.15.0-nightly.20261015.12"; + expect(stableVersionOf(nightly, "v0.0.48")).toBe("202610.15.0"); + expect(stableVersionOf(nightly, "v202610.14.2")).toBe("202610.15.0"); + // The same version again is the release workflow's call: it resumes or refuses by commit. + expect(stableVersionOf(nightly, "v202610.15.0")).toBe("202610.15.0"); + expect(() => stableVersionOf(nightly, "v202610.15.1")).toThrow(/older than the current stable/); + expect(() => stableVersionOf(nightly, "v202611.2.0")).toThrow(/older than the current stable/); + }); + + // The order every installer and updater relies on, in the comparison they use. + it("sorts each release above everything built before it", () => { + const first = nightlyVersion({ date: "20261015", runNumber: 12, tags: [] }); + const stable = stableVersionOf(first); + const sameDay = nightlyVersion({ date: "20261015", runNumber: 13, tags: [`v${stable}`] }); + const hotfix = stableVersionOf(sameDay); + const nextDay = nightlyVersion({ date: "20261016", runNumber: 14, tags: [`v${stable}`] }); + const nextYear = nightlyVersion({ date: "20270101", runNumber: 90, tags: [] }); + const ascending = [ + "0.0.48", + "0.0.49-nightly.20261010.3", + first, + stable, + sameDay, + hotfix, + nextDay, + nextYear, + ]; + expect(ascending.toSorted(compareSemverVersions)).toEqual(ascending); + expect(new Set(ascending).size).toBe(ascending.length); + }); +}); diff --git a/scripts/j5/release-version.ts b/scripts/j5/release-version.ts new file mode 100644 index 0000000000000..9da9148131d20 --- /dev/null +++ b/scripts/j5/release-version.ts @@ -0,0 +1,87 @@ +// @effect-diagnostics nodeBuiltinImport:off globalConsole:off - a standalone Node CLI the release workflows run before dependencies are installed. +import * as NodeFS from "node:fs"; +import * as NodeUtil from "node:util"; + +/** + * J5 versions are dates: `..`, the UTC day a build was made and a counter for the + * stable releases of that day. `202610.15.0` is the first stable release of 15 October 2026. + * A nightly is `..-nightly..`, where `n` is the next number no + * stable release of that day has taken, so it sorts above every stable release that already + * exists and below the stable release promoted from it. + */ +const STABLE = /^(\d{6})\.([1-9]|[12]\d|3[01])\.(0|[1-9]\d*)$/; +const NIGHTLY = /^(\d{6}\.(?:[1-9]|[12]\d|3[01])\.(?:0|[1-9]\d*))-nightly\.\d{8}\.\d+$/; + +/** The nightly version for a build made on `date` (UTC, `yyyymmdd`), given the repository's tags. */ +export function nightlyVersion(input: { + readonly date: string; + readonly runNumber: number; + readonly tags: ReadonlyArray; +}): string { + if (!/^\d{8}$/.test(input.date)) + throw new Error(`Expected a yyyymmdd date; found ${input.date}.`); + if (!Number.isSafeInteger(input.runNumber) || input.runNumber < 1) { + throw new Error(`Expected a positive run number; found ${input.runNumber}.`); + } + const day = `${input.date.slice(0, 6)}.${Number(input.date.slice(6))}`; + const taken = input.tags.flatMap((tag) => { + const match = STABLE.exec(tag.replace(/^v/, "")); + return match !== null && `${match[1]}.${match[2]}` === day ? [Number(match[3])] : []; + }); + const next = taken.length === 0 ? 0 : Math.max(...taken) + 1; + return `${day}.${next}-nightly.${input.date}.${input.runNumber}`; +} + +/** + * The stable version a nightly is promoted to: the nightly's own date and number. `latest` is the + * tag of the current stable release; promoting a nightly from before it would offer every stable + * install an older build, so that is refused. + */ +export function stableVersionOf(nightly: string, latest?: string): string { + const match = NIGHTLY.exec(nightly.replace(/^v/, "")); + if (match === null) { + throw new Error( + `Expected a nightly version (..-nightly..); found ${nightly}.`, + ); + } + const version = match[1]!; + if (latest !== undefined) { + const parts = (value: string) => value.replace(/^v/, "").split(".").map(Number); + const [candidate, current] = [parts(version), parts(latest)]; + const order = candidate.map((part, index) => part - current[index]!).find((diff) => diff !== 0); + if (order !== undefined && order < 0) { + throw new Error( + `${nightly} is older than the current stable release ${latest}. Promote a newer nightly.`, + ); + } + } + return version; +} + +if (import.meta.main) { + const { positionals, values } = NodeUtil.parseArgs({ + allowPositionals: true, + options: { + date: { type: "string" }, + "run-number": { type: "string" }, + "tags-file": { type: "string" }, + latest: { type: "string" }, + }, + }); + const [command, argument] = positionals; + let version: string; + if (command === "nightly") { + version = nightlyVersion({ + date: values.date ?? "", + runNumber: Number(values["run-number"]), + tags: NodeFS.readFileSync(values["tags-file"] ?? "", "utf8").split("\n"), + }); + } else if (command === "stable" && argument !== undefined) { + version = stableVersionOf(argument, values.latest || undefined); + } else { + throw new Error( + "Usage: release-version.ts nightly --date --run-number --tags-file | stable [--latest ]", + ); + } + console.log(version); +} From 977dd311044c413a7381d5d39c63332dd4befc76 Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Sun, 11 Oct 2026 15:02:46 -0400 Subject: [PATCH 2/3] docs(fork): the CI section describes date nightlies and stable promotion Co-Authored-By: Claude Opus 5.5 --- FORK.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FORK.md b/FORK.md index 64079155ad91c..b78342d1f72b2 100644 --- a/FORK.md +++ b/FORK.md @@ -627,7 +627,7 @@ The Muse and Kiro replay fixtures carry two D25 substitutions. The Muse replay c Fork-owned workflows use the Node version in `.nvmrc` (26.12.1 since the 2026-10-24 advance, the exact version upstream's `engines` names; upstream removed its own `.nvmrc` then, and J5 keeps one for its workflows and `fnm`), pnpm `12.14.0`, the frozen pnpm lockfile, and the repo-local Vite Plus binary. `J5 CI` is the gate for every PR, whatever its base branch, and for pushes to `j5/main` and the preview branches; `J5 Nightly` publishes `j5/main` and `J5 Stable` promotes a nightly, both under J5's date versions (`scripts/j5/release-version.ts`), so upstream's `scripts/resolve-nightly-release.ts` is not used; `J5 Weekly Full Build` is the -scheduled and manually dispatchable pre-rebase suite plus Apple Silicon desktop build. `J5 CI` runs the web suite on its own runner (`Test Web`), as upstream's `test_web` does, and installs headless Chromium in the server shards for upstream's preview browser tests; `J5 Weekly Full Build` installs it before its one full run. Upstream's vendored tree under `.repos` carries two gitlinks with no `.gitmodules`, which make `actions/checkout`'s credential cleanup fail; every J5 job that checks out the repository drops them from its disposable index in a last step, and no J5 checkout sets `persist-credentials: false`, because that runs the cleanup inside the checkout step. In `J5 Release` that leaves the token in the checkout until the job ends: the one job with a write token (`release`) runs no repository code, and the jobs that install and build hold a read-only token. `J5 Mobile CI` runs upstream's mobile native static analysis and an iOS simulator Debug build on macOS, each only when its native inputs change; both are advisory and outside the required check. `J5 Release` publishes CLI archives (darwin-arm64, linux-x64), SHA256SUMS, install.sh and the signed desktop build to GitHub Releases (case 40), as the latest release for a stable version and as a pre-release that is never latest for a `-preview..` or `-nightly..` version (procedure in `docs/j5/runbooks/macos-packaging.md`); npm publishing is retired. `J5 Nightly` (manual dispatch on `j5/main`; issue #507) resolves the next nightly version with upstream's `scripts/resolve-nightly-release.ts` and calls `J5 Signed macOS Build` and `J5 Release` with that commit and version. Called that way, both stamp the version with upstream's `scripts/update-release-package-versions.ts` during the build instead of reading committed manifests, the app is checked as `J5 Code (Nightly).app`, and the release must carry `nightly-mac.yml` and no `latest-mac.yml`. Run by hand, both behave as before. No upstream script or workflow is edited for this. It has no schedule yet; upstream's `.github/scripts/check-nightly-release.cjs` is the gate to add with one. Promoting a nightly's commit to stable is not built. The CLI archive job runs the database startup tests and the one-owner lock test (`apps/server/src/serverRuntimeState.test.ts`) on the Node the executable embeds, 26.12.1, which upstream's build now takes from `engines` in place of a pinned `SEA_NODE_VERSION`; it is `.nvmrc`'s version too since the 2026-10-24 advance. The job sets up that Node around `build-exe` (Node single-executables need `--build-sea`), runs every repo script through `pnpm exec` so the repo-local `vp` is on PATH, and applies production web icons before packing. +scheduled and manually dispatchable pre-rebase suite plus Apple Silicon desktop build. `J5 CI` runs the web suite on its own runner (`Test Web`), as upstream's `test_web` does, and installs headless Chromium in the server shards for upstream's preview browser tests; `J5 Weekly Full Build` installs it before its one full run. Upstream's vendored tree under `.repos` carries two gitlinks with no `.gitmodules`, which make `actions/checkout`'s credential cleanup fail; every J5 job that checks out the repository drops them from its disposable index in a last step, and no J5 checkout sets `persist-credentials: false`, because that runs the cleanup inside the checkout step. In `J5 Release` that leaves the token in the checkout until the job ends: the one job with a write token (`release`) runs no repository code, and the jobs that install and build hold a read-only token. `J5 Mobile CI` runs upstream's mobile native static analysis and an iOS simulator Debug build on macOS, each only when its native inputs change; both are advisory and outside the required check. `J5 Release` publishes CLI archives (darwin-arm64, linux-x64), SHA256SUMS, install.sh and the signed desktop build to GitHub Releases (case 40), as the latest release for a stable version and as a pre-release that is never latest for a `-preview..` or `-nightly..` version (procedure in `docs/j5/runbooks/macos-packaging.md`); npm publishing is retired. `J5 Nightly` (manual dispatch on `j5/main`; issue #507) names its build for the UTC day it runs and calls `J5 Release` with that commit and version. `J5 Stable` (manual dispatch on `j5/main`) takes a published nightly and calls `J5 Release` with the nightly's commit and its version without the nightly suffix. Called that way, `J5 Release` builds the desktop app with `J5 Signed macOS Build` in the same run and every build stamps the version with upstream's `scripts/update-release-package-versions.ts` instead of reading committed manifests; a nightly's app is checked as `J5 Code (Nightly).app` and its release must carry `nightly-mac.yml` and no `latest-mac.yml`, and a stable release the reverse. Run by hand, `J5 Signed macOS Build` behaves as before and `J5 Release` publishes only a preview. No upstream script or workflow is edited for this. `J5 Nightly` has no schedule yet; upstream's `.github/scripts/check-nightly-release.cjs` is the gate to add with one. The CLI archive job runs the database startup tests and the one-owner lock test (`apps/server/src/serverRuntimeState.test.ts`) on the Node the executable embeds, 26.12.1, which upstream's build now takes from `engines` in place of a pinned `SEA_NODE_VERSION`; it is `.nvmrc`'s version too since the 2026-10-24 advance. The job sets up that Node around `build-exe` (Node single-executables need `--build-sea`), runs every repo script through `pnpm exec` so the repo-local `vp` is on PATH, and applies production web icons before packing. Upstream's workflows stay in the tree behind `github.repository == 'pingdotgg/t3code'`, so they neither run nor publish from the fork. J5 adds the guard to every job in `ci.yml`, combined inside one `${{ }}` with upstream's `!cancelled()` condition where a job has one (on the aggregate `check` job as `always() && …`, so it is skipped on the fork instead of failing), on `mobile-eas-preview.yml` (beside upstream's own same-repository condition), `mobile-fingerprint-check.yml`, `thread-transfer-report.yml`, `stale-needs-more-info.yml`, `agent-context-budget.yml` (case 110), `mobile-eas-preview-fork.yml` and `mobile-fingerprint-label.yml`, on `resolve` and `cleanup` in `desktop-macos-preview-publish.yml`, on `deploy_preview` in `relay-preview.yml` and on all three jobs of `relay-preview-cleanup.yml`, and on every job in `issue-labels.yml`, `web-preview.yml`, `desktop-macos-preview.yml`, `mobile-showcase-screenshots.yml` and `windows-tests.yml`. Upstream carries the same guard itself, so those files equal upstream's, on `deploy_relay` in `deploy-relay.yml`, the `mirror` job of `mobile-android-apk.yml`, `production` in `mobile-eas-production.yml`, the `publish` job in `publish-aur.yml` and `resolve_commit` in `release.yml`; the other jobs of `release.yml` and `desktop-macos-preview-publish.yml` depend on the guarded ones. `release-desktop.yml` and `publish-aur.yml` are `workflow_call` only and are reached through `release.yml`. From c20c0deb8f5d53687a5f55e17a12e68e2baaf848 Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Sat, 21 Nov 2026 13:40:02 -0500 Subject: [PATCH 3/3] fix(release): J5 Stable follows the single-run release, and promotions refuse a mismatched tag or draft - J5 Release builds the desktop app itself since #1007, so J5 Stable calls only J5 Release, as J5 Nightly does. - J5 Nightly and J5 Stable share one concurrency group, so a stable release of the same day cannot land between a nightly picking its number and publishing. - J5 Stable fails before the signed builds when the stable tag already exists at another commit. - J5 Release refuses to publish into a draft that targets another commit. - The runbook says a stable's date is its nightly's, and names 0.0.51 and 0.0.52-nightly.* as the last 0.0.x releases. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/j5-nightly.yml | 4 +++- .github/workflows/j5-release.yml | 7 +++++++ .github/workflows/j5-stable.yml | 31 ++++++++++------------------- docs/j5/runbooks/macos-packaging.md | 12 +++++------ scripts/j5/release-version.test.ts | 6 +++--- scripts/j5/release-version.ts | 8 +++----- 6 files changed, 33 insertions(+), 35 deletions(-) diff --git a/.github/workflows/j5-nightly.yml b/.github/workflows/j5-nightly.yml index e9be13304ca81..a1c44094465cc 100644 --- a/.github/workflows/j5-nightly.yml +++ b/.github/workflows/j5-nightly.yml @@ -17,8 +17,10 @@ on: permissions: {} +# Shared with J5 Stable, so no stable release of today lands between this run +# picking its number and publishing. concurrency: - group: j5-nightly + group: j5-publish cancel-in-progress: false jobs: diff --git a/.github/workflows/j5-release.yml b/.github/workflows/j5-release.yml index bfdd75adb8b18..ee1746b80cb40 100644 --- a/.github/workflows/j5-release.yml +++ b/.github/workflows/j5-release.yml @@ -600,6 +600,13 @@ jobs: if tag_sha="$(gh api "repos/$GH_REPO/commits/$tag" --jq .sha 2>/dev/null)"; then test "$tag_sha" = "$RELEASE_SHA" fi + # A draft has no tag yet, so a draft a failed run left for another commit + # passes the check above; publishing into it would mislabel this build. + if target="$(gh release view "$tag" --json targetCommitish --jq .targetCommitish 2>/dev/null)" \ + && [[ "$target" != "$RELEASE_SHA" ]]; then + echo "::error::A release for $tag already targets $target, not $RELEASE_SHA. Delete that draft, or promote a newer nightly." + exit 1 + fi if ! gh release view "$tag" >/dev/null 2>&1; then if [[ "$RELEASE_CHANNEL" == nightly ]]; then cat > "$RUNNER_TEMP/release-notes.md" <..` (the nightly's version without its suffix) and # published as "latest". The stable build is of a commit nightly users already # ran. Nothing is committed: the version is stamped into the manifests during -# each build. +# each build. J5 Release builds the desktop app and the CLI archives and +# publishes them. on: workflow_dispatch: @@ -16,8 +17,10 @@ on: permissions: {} +# Shared with J5 Nightly: a nightly picks its number before its builds, so a +# stable release of the same day published meanwhile would sort above it. concurrency: - group: j5-stable + group: j5-publish cancel-in-progress: false jobs: @@ -70,6 +73,11 @@ jobs: latest="$(gh api "repos/$GITHUB_REPOSITORY/releases/latest" --jq '.tag_name')" version="$(node scripts/j5/release-version.ts stable "$tag" --latest "$latest")" ref="$(gh api "repos/$GITHUB_REPOSITORY/commits/$tag" --jq '.sha')" + # Fail before the signed builds when another nightly already took this number. + if taken="$(gh api "repos/$GITHUB_REPOSITORY/commits/v$version" --jq '.sha' 2>/dev/null)" && [[ "$taken" != "$ref" ]]; then + echo "::error::v$version is already released from $taken, not $tag ($ref). Promote a newer nightly." + exit 1 + fi echo "version=$version" >> "$GITHUB_OUTPUT" echo "ref=$ref" >> "$GITHUB_OUTPUT" echo "::notice::Promoting $tag ($ref) to J5 Code $version." @@ -87,26 +95,9 @@ jobs: subprocess.run(["git", "update-index", "--force-remove", "-z", "--stdin"], input=b"\0".join(paths) + b"\0", check=True) PYTHON - build: - name: Desktop build - needs: resolve - permissions: - contents: read - uses: ./.github/workflows/j5-macos-build.yml - with: - ref: ${{ needs.resolve.outputs.ref }} - version: ${{ needs.resolve.outputs.version }} - secrets: - CSC_LINK: ${{ secrets.CSC_LINK }} - CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} - APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} - APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} - APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} - - # Builds the CLI archives and publishes them with the desktop build above. release: name: Release - needs: [resolve, build] + needs: resolve permissions: contents: write actions: read diff --git a/docs/j5/runbooks/macos-packaging.md b/docs/j5/runbooks/macos-packaging.md index 9397dd0e46f55..44f4f2d4aaf14 100644 --- a/docs/j5/runbooks/macos-packaging.md +++ b/docs/j5/runbooks/macos-packaging.md @@ -71,8 +71,8 @@ T3 Code. ### Version numbers -A J5 version is a date: `..`, the UTC day the build was made and a counter for that -day's stable releases. `202610.15.0` is the first stable release of 15 October 2026 and +A J5 version is a date: `..`, the UTC day its nightly was built and a counter for that +day's stable releases. A nightly from the 15th promoted on the 17th is still `202610.15.0`. `202610.15.0` is the first stable release of 15 October 2026 and `202610.15.1` a second one that day. Month and day carry no leading zero beyond the month's own (`202701.5.0`), because version numbers may not. A nightly is `..-nightly..`, where `n` is the next number no stable release of that @@ -80,7 +80,7 @@ day has taken, so it sorts above every stable release that exists and below the it. `scripts/j5/release-version.ts` computes both. The numbers say nothing about upstream: the T3 Code release J5 is built on is `J5_UPSTREAM_T3_CODE_VERSION` (FORK.md case 59). -Releases through 0.0.48, and nightlies named `0.0.49-nightly.*`, predate this. Every date version +Releases through 0.0.51, and nightlies named `0.0.52-nightly.*`, predate this. Every date version sorts above them. Nothing is committed for a nightly or a stable release: the version is stamped into the four @@ -242,7 +242,7 @@ the time to repeat step 2. - `install.sh`, `install.ps1`, and `SHA256SUMS` over the archives and both installers. Called by `J5 Nightly` or `J5 Stable`, it is given the commit and the version, stamps the version -before building the CLI archives, and publishes the desktop build made earlier in the same run. It +before building, and builds the desktop app itself. It accepts only a date version from a caller. Run by hand with a build's run ID, its resolve job reads the version from the build commit's four manifests, which must agree, and publishes only a preview: a nightly comes only from `J5 Nightly` and a stable release only from `J5 Stable`, whatever the @@ -262,8 +262,8 @@ link beside it so a server from before the rename can run the update check that signs with Developer ID, and notarizes the app. It verifies the mounted app's identity (J5 Code, or J5 Code (Nightly) for a nightly version), signature, notarization ticket, and Gatekeeper assessment before uploading artifacts for 30 days. It does not create a GitHub Release. Run by hand it builds -the branch it was started on at the version that branch commits; `J5 Nightly` and `J5 Stable` call -it with a commit and a version to stamp. The workflow uses the Apple signing secrets and +the branch it was started on at the version that branch commits; `J5 Release` calls it with a +commit and a version to stamp when `J5 Nightly` or `J5 Stable` runs. The workflow uses the Apple signing secrets and `APPLE_TEAM_ID` repository variable; it converts the P12 export to a Keychain-compatible format. Clerk passkey provisioning is only required when Clerk/passkey configuration is supplied. diff --git a/scripts/j5/release-version.test.ts b/scripts/j5/release-version.test.ts index 9e78ece842eee..5da604d167ae7 100644 --- a/scripts/j5/release-version.test.ts +++ b/scripts/j5/release-version.test.ts @@ -41,7 +41,7 @@ describe("J5 date versions", () => { it("refuses to promote a nightly from before the current stable release", () => { const nightly = "v202610.15.0-nightly.20261015.12"; - expect(stableVersionOf(nightly, "v0.0.48")).toBe("202610.15.0"); + expect(stableVersionOf(nightly, "v0.0.51")).toBe("202610.15.0"); expect(stableVersionOf(nightly, "v202610.14.2")).toBe("202610.15.0"); // The same version again is the release workflow's call: it resumes or refuses by commit. expect(stableVersionOf(nightly, "v202610.15.0")).toBe("202610.15.0"); @@ -58,8 +58,8 @@ describe("J5 date versions", () => { const nextDay = nightlyVersion({ date: "20261016", runNumber: 14, tags: [`v${stable}`] }); const nextYear = nightlyVersion({ date: "20270101", runNumber: 90, tags: [] }); const ascending = [ - "0.0.48", - "0.0.49-nightly.20261010.3", + "0.0.51", + "0.0.52-nightly.20261117.18", first, stable, sameDay, diff --git a/scripts/j5/release-version.ts b/scripts/j5/release-version.ts index 9da9148131d20..4de9f387f776c 100644 --- a/scripts/j5/release-version.ts +++ b/scripts/j5/release-version.ts @@ -3,11 +3,9 @@ import * as NodeFS from "node:fs"; import * as NodeUtil from "node:util"; /** - * J5 versions are dates: `..`, the UTC day a build was made and a counter for the - * stable releases of that day. `202610.15.0` is the first stable release of 15 October 2026. - * A nightly is `..-nightly..`, where `n` is the next number no - * stable release of that day has taken, so it sorts above every stable release that already - * exists and below the stable release promoted from it. + * J5 versions are dates, `..`: a nightly's UTC build day and a counter for that + * day's stable releases. A nightly takes the next `n` no stable release of its day has, so it sorts + * above every existing stable release and below the one promoted from it. */ const STABLE = /^(\d{6})\.([1-9]|[12]\d|3[01])\.(0|[1-9]\d*)$/; const NIGHTLY = /^(\d{6}\.(?:[1-9]|[12]\d|3[01])\.(?:0|[1-9]\d*))-nightly\.\d{8}\.\d+$/;