From 1757a9a4f3199f1c54f8e4665bae2de1e9e1e621 Mon Sep 17 00:00:00 2001 From: liammclennan-ro Date: Wed, 25 Nov 2026 10:16:54 +1000 Subject: [PATCH 1/4] Comment --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 668693bb..5f7201ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,8 +27,7 @@ jobs: runs-on: windows-latest permissions: - # Required for creating GitHub releases. - contents: write + contents: read steps: - uses: actions/checkout@v6 From 285289d4b0a43f2f1c4a35be6685599a91bd5ab7 Mon Sep 17 00:00:00 2001 From: liammclennan-ro Date: Wed, 25 Nov 2026 16:19:39 +1000 Subject: [PATCH 2/4] Update github workflows. --- .github/workflows/ci.yml | 33 ++++++++++++++------ .github/workflows/publish.yml | 57 ++++++++++++++++++++++++++++++++--- build/Build.Windows.ps1 | 24 +++------------ build/README.md | 18 ++++++----- 4 files changed, 91 insertions(+), 41 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f7201ab..480e3c7d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,6 @@ -# If this file is renamed, the incrementing run attempt number will be reset. If the workflow's -# `name` changes, the `workflow_run` trigger in publish.yml must be updated. +# Builds, tests and packages (on Windows and Linux) the project on merges or PRs to 'dev' or 'main'. +# Saves artifacts (from Windows job) on merges to main, or when the workflow is manually triggered with 'Publish a GitHub release and packages'. +# The Linux job publishes a docker image on every build. name: CI @@ -11,7 +12,7 @@ on: workflow_dispatch: inputs: publish: - description: 'Publish a GitHub release' + description: 'Publish a GitHub release and packages' type: boolean required: true default: true @@ -26,6 +27,9 @@ jobs: name: Build (Windows) runs-on: windows-latest + # A manual run with the `publish` input unchecked does nothing. + if: github.event_name != 'workflow_dispatch' || inputs.publish + permissions: contents: read @@ -35,16 +39,15 @@ jobs: uses: actions/setup-dotnet@v5 with: dotnet-version: 10.0.x - - name: Build and Publish + - name: Build and Package env: DOTNET_CLI_TELEMETRY_OPTOUT: true - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: pwsh run: | ./build/Build.Windows.ps1 - name: Upload packages - # Consumed by the publish-nuget job in publish.yml - if: github.event_name != 'pull_request' + # Consumed by the publish-nuget and publish-github jobs in publish.yml + if: env.CI_PUBLISH == 'true' uses: actions/upload-artifact@v7 with: name: packages @@ -52,8 +55,8 @@ jobs: if-no-files-found: error retention-days: 1 - name: Upload archives - # Consumed by the publish-npm job in publish.yml - if: github.event_name != 'pull_request' + # Consumed by the publish-npm and publish-github jobs in publish.yml + if: env.CI_PUBLISH == 'true' uses: actions/upload-artifact@v7 with: name: archives @@ -62,11 +65,23 @@ jobs: artifacts/seqcli-*-*.tar.gz if-no-files-found: error retention-days: 1 + - name: Upload docs + # Consumed by the publish-github job in publish.yml + if: env.CI_PUBLISH == 'true' + uses: actions/upload-artifact@v7 + with: + name: docs + path: artifacts/seqcli-*.md + if-no-files-found: error + retention-days: 1 build-linux: name: Build (Linux) runs-on: ubuntu-24.04 + # A manual run with the `publish` input unchecked does nothing. + if: github.event_name != 'workflow_dispatch' || inputs.publish + permissions: contents: write diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1e9b6548..fd008fc7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,4 @@ -# Publishes the packages built by a successful CI run to NuGet.org and npm +# Publishes the packages built by a successful CI run to NuGet.org and npm, then creates a Github release. name: Publish @@ -22,8 +22,9 @@ jobs: if: >- github.event.workflow_run.conclusion == 'success' && - (github.event.workflow_run.event == 'push' || github.event.workflow_run.event == 'workflow_dispatch') && - github.event.workflow_run.head_repository.full_name == github.repository + github.event.workflow_run.head_repository.full_name == github.repository && + (github.event.workflow_run.event == 'workflow_dispatch' || + (github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main')) permissions: # Required to download artifacts from the triggering CI run. @@ -67,8 +68,9 @@ jobs: if: >- github.event.workflow_run.conclusion == 'success' && - (github.event.workflow_run.event == 'push' || github.event.workflow_run.event == 'workflow_dispatch') && - github.event.workflow_run.head_repository.full_name == github.repository + github.event.workflow_run.head_repository.full_name == github.repository && + (github.event.workflow_run.event == 'workflow_dispatch' || + (github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main')) permissions: # Required to download artifacts from the triggering CI run. @@ -104,3 +106,48 @@ jobs: shell: pwsh run: | ./build/Build.Npm.ps1 -ArchiveDir ./npm-archives + + publish-github: + name: Publish (GitHub release) + runs-on: ubuntu-24.04 + + # Only create a release once the packages are on NuGet.org and npm. + needs: [ publish-nuget, publish-npm ] + + permissions: + # Required to download artifacts from the triggering CI run. + actions: read + # Required to create the release and its tag. + contents: write + + steps: + # Build.Common.ps1 and baseversion, at the commit CI built, to reproduce its version. + - uses: actions/checkout@v6 + with: + ref: ${{ github.event.workflow_run.head_sha }} + persist-credentials: false + - name: Download release assets + # Every artifact of the CI run: `packages`, `archives` and `docs`. + uses: actions/download-artifact@v8 + with: + path: release-assets + merge-multiple: true + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ github.token }} + - name: Create release + env: + GH_TOKEN: ${{ github.token }} + HEAD_SHA: ${{ github.event.workflow_run.head_sha }} + shell: pwsh + run: | + . ./build/Build.Common.ps1 + $version = Get-SemVer + Write-Host "Creating release for version $version" + + $arguments = @('release', 'create', "v$version", '--title', "v$version", '--target', $env:HEAD_SHA, '--generate-notes', '--repo', $env:GITHUB_REPOSITORY) + if ($env:CI_TARGET_BRANCH -ne 'main') { $arguments += '--prerelease' } + $assets = @(Get-ChildItem ./release-assets -File | ForEach-Object { $_.FullName }) + if ($assets.Count -eq 0) { throw "No release assets found in ./release-assets" } + + & gh @arguments @assets + if ($LASTEXITCODE -ne 0) { throw "Creating the release failed" } diff --git a/build/Build.Windows.ps1 b/build/Build.Windows.ps1 index 8c22b65c..6b2f33fe 100644 --- a/build/Build.Windows.ps1 +++ b/build/Build.Windows.ps1 @@ -48,7 +48,7 @@ function Create-ArtifactDir mkdir ./artifacts } -function Publish-Archives($version) +function Create-Archives($version) { $rids = $([xml](Get-Content .\src\SeqCli\SeqCli.csproj)).Project.PropertyGroup.RuntimeIdentifiers.Split(';') foreach ($rid in $rids) { @@ -78,7 +78,7 @@ function Publish-Archives($version) } } -function Publish-DotNetTool($version) +function Package-DotNetTool($version) { Write-Output "Building dotnet tool" @@ -95,18 +95,6 @@ function Publish-Docs($version) if($LASTEXITCODE -ne 0) { throw "Build failed" } } -function Upload-GitHubRelease($version) -{ - Write-Output "Creating release for version $version" - - $prerelease = ""; - if ($env:CI_TARGET_BRANCH -ne "main") { - $prerelease = "--prerelease "; - } - - iex "gh release create v$version --title v$version $prerelease--generate-notes $(get-item ./artifacts/*)" -} - function Remove-GlobalJson { if(Test-Path ./global.json) { rm ./global.json } @@ -127,15 +115,11 @@ Clean-Output Create-ArtifactDir Create-GlobalJson Restore-Packages -Publish-Archives($version) -Publish-DotNetTool($version) +Create-Archives($version) +Package-DotNetTool($version) Execute-Tests($version) Publish-Docs($version) -if ($env:CI_PUBLISH -eq "True") { - Upload-GitHubRelease($version) -} - Remove-GlobalJson Pop-Location diff --git a/build/README.md b/build/README.md index b6edd53a..04276f73 100644 --- a/build/README.md +++ b/build/README.md @@ -5,7 +5,7 @@ This directory holds the PowerShell scripts that build, test, package, and publi | Script | Runs on | Produces | |---|---|---| | `Build.Common.ps1` | (dot-sourced by the others) | Version number helpers | -| `Build.Windows.ps1` | Windows | Release archives for every platform, the `seqcli` .NET tool package, generated docs, a GitHub release | +| `Build.Windows.ps1` | Windows | Release archives for every platform, the `seqcli` .NET tool package, generated docs | | `Build.Linux.ps1` | Linux | `datalust/seqcli` Docker images for `linux/amd64` and `linux/arm64` | | `Build.Npm.ps1` | Linux (any OS locally) | `@datalust/seqcli` and `@datalust/seqcli-` npm packages | @@ -33,7 +33,7 @@ npm enforces strict semver, which forbids leading zeros in numeric components, s The workflow runs on pushes and pull requests to `dev` and `main`, and can be triggered manually with `workflow_dispatch`. Two jobs run: -1. **Build (Windows)** runs `Build.Windows.ps1`. On non-PR builds, it then uploads the tool package as a workflow artifact named `packages`, and the release archives as one named `archives`, for the publish workflow to consume. +1. **Build (Windows)** runs `Build.Windows.ps1`. When `CI_PUBLISH` is set (pushes to `main`, and manual runs with the `publish` input checked), it then uploads the tool package as a workflow artifact named `packages`, the release archives as one named `archives`, and the markdown command reference as one named `docs`, for the publish workflow to consume. 2. **Build (Linux)** runs `Build.Linux.ps1`, after configuring `binfmt` so that ARM64 images can be built on the x64 runner. It runs in parallel with the Windows job. Environment variables control what gets published: @@ -42,8 +42,7 @@ Environment variables control what gets published: |---|---|---| | `CI_BUILD_NUMBER_BASE` | `github.run_number` | Build number component of the version | | `CI_TARGET_BRANCH` | `github.head_ref` or `github.ref_name` | Branch component of the version | -| `CI_PUBLISH` | `True` for pushes to `main`, or when the manual `publish` input is set | Whether `Build.Windows.ps1` creates a GitHub release | -| `GH_TOKEN` | `secrets.GITHUB_TOKEN` | Used by `gh release create` | +| `CI_PUBLISH` | `True` for pushes to `main`, or when the manual `publish` input is set | Whether CI uploads the artifacts the publish workflow publishes to NuGet, npm and a GitHub release | | `DOCKER_USER`, `DOCKER_TOKEN` | Docker Hub secrets | When `DOCKER_TOKEN` is non-empty, `Build.Linux.ps1` pushes images | | `SEQ_DOCKER_TAG` | e.g. `2026.1` | Seq image tag used for the Linux end-to-end tests | @@ -51,10 +50,13 @@ GitHub supplies no secrets or OIDC tokens to pull requests from forks, and PR bu ## The publish workflow -`publish.yml` runs via `workflow_run` when the CI workflow completes. It only publishes when that CI run succeeded, and was started by a push or manual dispatch on `dev` or `main` in this repository; it does nothing for pull requests. Two jobs run, independently: +`publish.yml` runs via `workflow_run` when the CI workflow completes. It only publishes when that CI run succeeded in this repository, and was either a push to `main` or a manual dispatch on `dev` or `main`; it does nothing for pull requests or pushes to `dev`. Three jobs run: 1. **Publish (NuGet)** downloads the `packages` artifact from the CI run and pushes it to NuGet.org. 2. **Publish (npm)** checks out the commit CI built, downloads the `archives` artifact, and runs `Build.Npm.ps1`. +3. **Publish (GitHub release)** runs only after both of the above succeed. It downloads all three artifacts and creates release `v` at the commit CI built, with them attached; builds from branches other than `main` are marked as prereleases. + +The NuGet and npm jobs run in parallel. Both registries use [trusted publishing](https://learn.microsoft.com/nuget/nuget-org/trusted-publishing). @@ -63,12 +65,14 @@ Both registries use [trusted publishing](https://learn.microsoft.com/nuget/nuget | Trigger | GitHub release | NuGet | Docker Hub | npm | |---|---|---|---|---| | Pull request | no | no | no | no | -| Push to `dev` | no (unless manual `publish`) | prerelease version | `datalust/seqcli-ci:` | prerelease, dist-tag `dev` | +| Push to `dev` | no | no | `datalust/seqcli-ci:` | no | | Push to `main` | yes, `v` | release version | `datalust/seqcli-ci:` | release, dist-tag `latest` | +| Manual run, `publish` checked | yes (prerelease unless on `main`) | prerelease version unless on `main` | `datalust/seqcli-ci:` | prerelease (dist-tag `dev`) unless on `main` | +| Manual run, `publish` unchecked | no (CI skips its jobs) | no | no | no | Note that `Build.Linux.ps1` always pushes to the `datalust/seqcli-ci` repository (the image name with a `-ci` suffix), never directly to `datalust/seqcli`. Promoting an image to the public `datalust/seqcli` repository, and tagging it `latest`, is a separate step outside this repository. -To publish a release from `dev` (for example a preview build), run the workflow manually from the Actions tab with the **Publish a GitHub release** input checked. The release is marked as a prerelease because the branch is not `main`. +To publish a release from `dev` (for example a preview build), run the workflow manually from the Actions tab with the **Publish a GitHub release and packages** input checked; this also publishes to NuGet and npm. The release is marked as a prerelease because the branch is not `main`. ## Running the builds locally From 01aaa06606e4f2fc83845a5d9c90ba9f9f630aac Mon Sep 17 00:00:00 2001 From: liammclennan-ro Date: Wed, 25 Nov 2026 17:00:18 +1000 Subject: [PATCH 3/4] Review feedback. Assisted-by: claude/fable5-2 --- .github/workflows/ci.yml | 2 +- .github/workflows/publish.yml | 118 +++++++++++++++++++++------------- build/README.md | 11 ++-- 3 files changed, 81 insertions(+), 50 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 480e3c7d..7cb1278b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,7 +83,7 @@ jobs: if: github.event_name != 'workflow_dispatch' || inputs.publish permissions: - contents: write + contents: read steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index fd008fc7..41379161 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,5 @@ -# Publishes the packages built by a successful CI run to NuGet.org and npm, then creates a Github release. +# Publishes the packages built by a successful CI run: creates a draft GitHub release, pushes the +# packages to NuGet.org and npm, then publishes the release once both registries have succeeded. name: Publish @@ -16,8 +17,8 @@ env: CI_TARGET_BRANCH: ${{ github.event.workflow_run.head_branch }} jobs: - publish-nuget: - name: Publish (NuGet) + draft-release: + name: Draft GitHub release runs-on: ubuntu-24.04 if: >- @@ -26,6 +27,65 @@ jobs: (github.event.workflow_run.event == 'workflow_dispatch' || (github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main')) + permissions: + # Required to download artifacts from the triggering CI run. + actions: read + # Required to create the release. + contents: write + + outputs: + tag: ${{ steps.draft.outputs.tag }} + + steps: + # Build.Common.ps1 and baseversion, at the commit CI built, to reproduce its version. + - uses: actions/checkout@v6 + with: + ref: ${{ github.event.workflow_run.head_sha }} + persist-credentials: false + - name: Download release assets + # Every artifact of the CI run: `packages`, `archives` and `docs`. + uses: actions/download-artifact@v8 + with: + path: release-assets + merge-multiple: true + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ github.token }} + - name: Create draft release + # The tag isn't created until the release is published, at the commit given by --target. + id: draft + env: + GH_TOKEN: ${{ github.token }} + HEAD_SHA: ${{ github.event.workflow_run.head_sha }} + shell: pwsh + run: | + . ./build/Build.Common.ps1 + $tag = "v$(Get-SemVer)" + "tag=$tag" >> $env:GITHUB_OUTPUT + + $assets = @(Get-ChildItem ./release-assets -File | ForEach-Object { $_.FullName }) + if ($assets.Count -eq 0) { throw "No release assets found in ./release-assets" } + + $isDraft = gh release view $tag --repo $env:GITHUB_REPOSITORY --json isDraft --jq .isDraft 2>$null + if ($LASTEXITCODE -eq 0) { + # A draft left by an earlier attempt of this run; refresh its assets. + if ($isDraft -ne 'true') { throw "Release $tag has already been published" } + Write-Host "Updating existing draft release $tag" + & gh release upload $tag --repo $env:GITHUB_REPOSITORY --clobber @assets + if ($LASTEXITCODE -ne 0) { throw "Uploading release assets failed" } + } else { + Write-Host "Creating draft release $tag" + $arguments = @('release', 'create', $tag, '--draft', '--title', $tag, '--target', $env:HEAD_SHA, '--generate-notes', '--repo', $env:GITHUB_REPOSITORY) + if ($env:CI_TARGET_BRANCH -ne 'main') { $arguments += '--prerelease' } + & gh @arguments @assets + if ($LASTEXITCODE -ne 0) { throw "Creating the draft release failed" } + } + + publish-nuget: + name: Publish (NuGet) + runs-on: ubuntu-24.04 + + needs: draft-release + permissions: # Required to download artifacts from the triggering CI run. actions: read @@ -58,7 +118,7 @@ jobs: $packages = @(Get-ChildItem ./packages/*.nupkg) if ($packages.Count -eq 0) { throw "No packages found in ./packages" } foreach ($nupkg in $packages) { - dotnet nuget push "$nupkg" --api-key "$env:NUGET_API_KEY" --source https://api.nuget.org/v3/index.json + dotnet nuget push "$nupkg" --api-key "$env:NUGET_API_KEY" --source https://api.nuget.org/v3/index.json --skip-duplicate if ($LASTEXITCODE -ne 0) { throw "Publishing failed" } } @@ -66,11 +126,7 @@ jobs: name: Publish (npm) runs-on: ubuntu-24.04 - if: >- - github.event.workflow_run.conclusion == 'success' && - github.event.workflow_run.head_repository.full_name == github.repository && - (github.event.workflow_run.event == 'workflow_dispatch' || - (github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main')) + needs: draft-release permissions: # Required to download artifacts from the triggering CI run. @@ -80,8 +136,8 @@ jobs: id-token: write steps: - # Build.Npm.ps1 and the package templates under ./npm, at the commit CI built. The checks - # above guarantee this is a commit pushed to this repository, not pull request code. + # Build.Npm.ps1 and the package templates under ./npm, at the commit CI built. The checks on + # the draft-release job guarantee this is a commit pushed to this repository, not pull request code. - uses: actions/checkout@v6 with: ref: ${{ github.event.workflow_run.head_sha }} @@ -108,46 +164,20 @@ jobs: ./build/Build.Npm.ps1 -ArchiveDir ./npm-archives publish-github: - name: Publish (GitHub release) + name: Publish GitHub release runs-on: ubuntu-24.04 - # Only create a release once the packages are on NuGet.org and npm. - needs: [ publish-nuget, publish-npm ] + # Only publish the release once the packages are on NuGet.org and npm. + needs: [ draft-release, publish-nuget, publish-npm ] permissions: - # Required to download artifacts from the triggering CI run. - actions: read - # Required to create the release and its tag. + # Required to publish the release and create its tag. contents: write steps: - # Build.Common.ps1 and baseversion, at the commit CI built, to reproduce its version. - - uses: actions/checkout@v6 - with: - ref: ${{ github.event.workflow_run.head_sha }} - persist-credentials: false - - name: Download release assets - # Every artifact of the CI run: `packages`, `archives` and `docs`. - uses: actions/download-artifact@v8 - with: - path: release-assets - merge-multiple: true - run-id: ${{ github.event.workflow_run.id }} - github-token: ${{ github.token }} - - name: Create release + - name: Publish release env: GH_TOKEN: ${{ github.token }} - HEAD_SHA: ${{ github.event.workflow_run.head_sha }} - shell: pwsh + TAG: ${{ needs.draft-release.outputs.tag }} run: | - . ./build/Build.Common.ps1 - $version = Get-SemVer - Write-Host "Creating release for version $version" - - $arguments = @('release', 'create', "v$version", '--title', "v$version", '--target', $env:HEAD_SHA, '--generate-notes', '--repo', $env:GITHUB_REPOSITORY) - if ($env:CI_TARGET_BRANCH -ne 'main') { $arguments += '--prerelease' } - $assets = @(Get-ChildItem ./release-assets -File | ForEach-Object { $_.FullName }) - if ($assets.Count -eq 0) { throw "No release assets found in ./release-assets" } - - & gh @arguments @assets - if ($LASTEXITCODE -ne 0) { throw "Creating the release failed" } + gh release edit "$TAG" --draft=false --repo "$GITHUB_REPOSITORY" diff --git a/build/README.md b/build/README.md index 04276f73..398f230f 100644 --- a/build/README.md +++ b/build/README.md @@ -50,13 +50,14 @@ GitHub supplies no secrets or OIDC tokens to pull requests from forks, and PR bu ## The publish workflow -`publish.yml` runs via `workflow_run` when the CI workflow completes. It only publishes when that CI run succeeded in this repository, and was either a push to `main` or a manual dispatch on `dev` or `main`; it does nothing for pull requests or pushes to `dev`. Three jobs run: +`publish.yml` runs via `workflow_run` when the CI workflow completes. It only publishes when that CI run succeeded in this repository, and was either a push to `main` or a manual dispatch on `dev` or `main`; it does nothing for pull requests or pushes to `dev`. Four jobs run: -1. **Publish (NuGet)** downloads the `packages` artifact from the CI run and pushes it to NuGet.org. -2. **Publish (npm)** checks out the commit CI built, downloads the `archives` artifact, and runs `Build.Npm.ps1`. -3. **Publish (GitHub release)** runs only after both of the above succeed. It downloads all three artifacts and creates release `v` at the commit CI built, with them attached; builds from branches other than `main` are marked as prereleases. +1. **Draft GitHub release** downloads all three artifacts and creates a draft release `v` targeting the commit CI built, with them attached; builds from branches other than `main` are marked as prereleases. Drafts are visible only to people with write access, and the tag isn't created until the release is published. +2. **Publish (NuGet)** downloads the `packages` artifact from the CI run and pushes it to NuGet.org. +3. **Publish (npm)** checks out the commit CI built, downloads the `archives` artifact, and runs `Build.Npm.ps1`. +4. **Publish GitHub release** runs only after both registries succeed, and publishes the draft, which creates the tag. -The NuGet and npm jobs run in parallel. +The NuGet and npm jobs run in parallel, after the draft is created. If either fails, the draft is left in place; re-running the failed jobs publishes it once they succeed. Re-running the draft job updates the existing draft's assets rather than creating another. Both registries use [trusted publishing](https://learn.microsoft.com/nuget/nuget-org/trusted-publishing). From f49a4c7dd722ce7c6bbfe1d3a4e1bc842d3ff5d8 Mon Sep 17 00:00:00 2001 From: liammclennan-ro Date: Wed, 25 Nov 2026 17:09:02 +1000 Subject: [PATCH 4/4] README --- build/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/README.md b/build/README.md index 398f230f..e2b08797 100644 --- a/build/README.md +++ b/build/README.md @@ -20,7 +20,7 @@ Every artifact from one CI run shares a single version, computed by `Get-SemVer` ``` * `` is read from [`baseversion`](../baseversion) in the repository root (e.g. `2026.1`). Bump it there when starting a new release line. -* `` is `CI_BUILD_NUMBER_BASE + 2300`, zero-padded to five digits (e.g. `02616`). `CI_BUILD_NUMBER_BASE` is the GitHub Actions `run_number`; the fixed offset keeps build numbers increasing across the move from the previous CI system. Note the comment at the top of `ci.yml`: renaming the workflow file resets `run_number`, which would produce lower version numbers than already-published releases. Locally, where the variable is unset, the build number is the literal string `local`. +* `` is `CI_BUILD_NUMBER_BASE + 2300`, zero-padded to five digits (e.g. `02616`). `CI_BUILD_NUMBER_BASE` is the GitHub Actions `run_number`; the fixed offset keeps build numbers increasing across the move from the previous CI system. Renaming the workflow file resets `run_number`, which would produce lower version numbers than already-published releases. Locally, where the variable is unset, the build number is the literal string `local`. * The prerelease suffix is added for every branch except `main`. It is the first ten characters of the branch name, stripped of anything other than letters, digits and hyphens, followed by the build number. A `dev` build is therefore `2026.1.02700-dev-02700`; a `main` build is `2026.1.02616`. `CI_TARGET_BRANCH` overrides the branch detected from git. In CI it is set from `github.head_ref` (for pull requests) or `github.ref_name`.