From 1c5ec4512471a5d295b034c3507d50d4b479a280 Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Wed, 18 Nov 2026 18:56:06 -0500 Subject: [PATCH 1/3] ci: releases need a second approver and come only from attested builds The Release workflow builds the packages from a commit on main (the merge commit of an update/ PR, or a commit given to a dispatch on main) and attests each file's provenance. A member of code-server-release-team other than the person who started the run then approves the release-approval environment. Only that job, as the coder-release-publisher App (key in Cloud KMS), creates the tag and publishes the release with the attested files, in one step. Releases are immutable, so the files can't change after that, and there is no draft for anyone to edit. publish.yaml publishes nothing until it has checked that the release came from coder-release-publisher, is immutable, and that every file was attested by release.yaml from main. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/publish.yaml | 43 ++++ .github/workflows/release.yaml | 357 ++++++++++++++++++++++++++------- docs/MAINTAINING.md | 44 ++-- 3 files changed, 360 insertions(+), 84 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 61909bd732c9..750d39abd7ab 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -12,6 +12,8 @@ on: release: types: [released] +permissions: {} + # Cancel in-progress runs for pull requests when developers push # additional changes, and serialize builds in branches. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-concurrency-to-cancel-any-in-progress-job-or-run @@ -20,8 +22,47 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: + # Nothing is published unless the release came from release.yaml: coder-release-publisher made + # it (only release.yaml's approve job can sign as that App, after a second person approved), it + # is published and immutable, and every file was built and attested by release.yaml from main. + verify: + runs-on: ubuntu-latest + permissions: + contents: read + attestations: read + env: + GH_TOKEN: ${{ github.token }} + TAG: ${{ inputs.version || github.ref_name }} + steps: + - name: Check the release + run: | + set -euo pipefail + fail() { echo "::error::$*"; exit 1; } + # TAG comes from the dispatch input, so only a version may reach the shell. + [[ "$TAG" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$ ]] || fail "The version must look like v1.2.3 or v1.2.3-rc.1." + tag="v${TAG#v}" + release="$(gh api "repos/$GITHUB_REPOSITORY/releases/tags/$tag")" + author="$(jq -r .author.login <<<"$release")" + [[ "$author" == "coder-release-publisher[bot]" ]] || fail "$tag was published by $author, not by release.yaml (coder-release-publisher)." + [[ "$(jq -r .draft <<<"$release")" == "false" ]] || fail "$tag is a draft." + [[ "$(jq -r .immutable <<<"$release")" == "true" ]] || fail "$tag is not an immutable release." + + - name: Verify the files + run: | + set -euo pipefail + tag="v${TAG#v}" + gh release download "$tag" --repo "$GITHUB_REPOSITORY" --dir release-files + for f in release-files/*; do + gh attestation verify "$f" \ + --repo "$GITHUB_REPOSITORY" \ + --signer-workflow "$GITHUB_REPOSITORY/.github/workflows/release.yaml" \ + --source-ref refs/heads/main \ + --deny-self-hosted-runners + done + npm: runs-on: ubuntu-latest + needs: verify environment: release permissions: # Required so GitHub can issue an OIDC token for trusted publishing. @@ -60,6 +101,7 @@ jobs: aur: runs-on: ubuntu-latest + needs: verify environment: release permissions: contents: read @@ -135,6 +177,7 @@ jobs: docker: runs-on: ubuntu-latest + needs: verify # Scopes the Docker Hub OIDC subject claim to # repo:coder/code-server:environment:release. environment: release diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5d56fe9041fb..5d06ce2cbfdc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,33 +1,117 @@ -name: Draft release +name: Release + +# Builds a release from a commit on main, waits for a second person, then tags and publishes it. +# +# prepare Works out the version and the commit to build: the merge commit of an update/ PR, +# or the commit given to a dispatch on main. +# package-* Build the packages from that commit and attest each file's provenance. Nothing here +# can create a tag or a release. +# approve Waits in the release-approval environment for a member of +# code-server-release-team other than the person who started the run. Then, as the +# coder-release-publisher App (its key is in Cloud KMS, and only this job of main's +# copy of this file may sign with it), it creates the tag and publishes the release +# with the attested files. Releases are immutable once published. +# +# Publishing the release starts publish.yaml (npm, Docker Hub, GHCR, AUR), which checks that the +# release came from here before it publishes anything. on: workflow_dispatch: inputs: version: + description: "Version to release, e.g. 4.106.0 or 4.106.0-rc.1 (the major version is always 4)" type: string required: true + commit: + description: "Full SHA of the commit on main to release" + type: string + required: true + prerelease: + description: "Publish as a pre-release (npm, Docker and the AUR are not updated)" + type: boolean + default: false pull_request_target: types: - closed branches: - main -permissions: - contents: write # For creating releases. +permissions: {} -# Cancel in-progress runs for pull requests when developers push -# additional changes +# Releases never cancel each other. concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} + cancel-in-progress: false jobs: - package-linux: - name: ${{ format('linux-{0}', matrix.vscode_arch) }} - runs-on: ubuntu-22.04 + prepare: + name: Prepare + runs-on: ubuntu-24.04 if: >- (github.event_name == 'workflow_dispatch') || (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true && startsWith(github.head_ref, 'update/')) + permissions: + contents: read + outputs: + version: ${{ steps.prepare.outputs.version }} + commit: ${{ steps.prepare.outputs.commit }} + prerelease: ${{ steps.prepare.outputs.prerelease }} + steps: + - name: Work out the version and the commit + id: prepare + env: + GH_TOKEN: ${{ github.token }} + EVENT: ${{ github.event_name }} + INPUT_VERSION: ${{ inputs.version }} + INPUT_COMMIT: ${{ inputs.commit }} + INPUT_PRERELEASE: ${{ inputs.prerelease }} + HEAD_REF: ${{ github.head_ref }} + MERGE_COMMIT: ${{ github.event.pull_request.merge_commit_sha }} + run: | + set -euo pipefail + fail() { echo "::error::$*"; exit 1; } + + # The tag is created by main's copy of this file only (the release-approval environment + # and Cloud KMS both require it), so a dispatch from any other ref is refused here. + [[ "$GITHUB_REF" == "refs/heads/main" ]] || fail "Run this workflow on main, not $GITHUB_REF." + + if [[ "$EVENT" == "pull_request_target" ]]; then + # The merge commit of the update/ PR, which is on main. + version="$HEAD_REF" + commit="$MERGE_COMMIT" + prerelease=false + else + version="$INPUT_VERSION" + commit="$INPUT_COMMIT" + prerelease="$INPUT_PRERELEASE" + fi + + # update/1.106.0 or v4.106.0 becomes 4.106.0: code-server keeps VS Code's minor and patch. + version=${version#update/} + version=${version#v} + version=4${version:1} + [[ "$version" =~ ^4\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?$ ]] || fail "Version must look like 4.106.0 or 4.106.0-rc.1, got '$version'." + [[ "$commit" =~ ^[0-9a-f]{40}$ ]] || fail "Commit must be a full 40-character SHA, got '$commit'." + + # The commit must be on main: main is identical to it or ahead of it. + status="$(gh api "repos/$GITHUB_REPOSITORY/compare/$commit...main" --jq .status)" + [[ "$status" == "identical" || "$status" == "ahead" ]] || fail "$commit is not on main." + + { + echo "version=$version" + echo "commit=$commit" + echo "prerelease=$prerelease" + } >> "$GITHUB_OUTPUT" + echo "Releasing v$version from $commit (pre-release: $prerelease)." + + package-linux: + name: ${{ format('linux-{0}', matrix.vscode_arch) }} + runs-on: ubuntu-22.04 + needs: prepare + permissions: + contents: read + id-token: write # To sign the provenance attestations. + attestations: write strategy: matrix: @@ -43,7 +127,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ELECTRON_SKIP_BINARY_DOWNLOAD: 1 PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 - TAG: ${{ inputs.version || github.event.pull_request.head.ref || github.ref_name }} + VERSION: ${{ needs.prepare.outputs.version }} # Set release package name. ARCH: ${{ matrix.package_arch }} # Cross-compile target. @@ -68,18 +152,13 @@ jobs: curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm echo "$HOME/.local/bin" >> $GITHUB_PATH - - name: Strip update/ and v from tag and set major version - run: | - version=${TAG#update/} - version=${version#v} - version=4${version:1} - echo "VERSION=$version" >> $GITHUB_ENV - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 with: + # The commit prepare checked is on main, never a PR head. + ref: ${{ needs.prepare.outputs.commit }} submodules: true - # When an update/ branch is merged, a release is automatically created - # which requires secrets. + persist-credentials: false + # A merged update/ PR starts a release through pull_request_target. allow-unsafe-pr-checkout: true - run: quilt push -a - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 @@ -109,34 +188,32 @@ jobs: if: ${{ matrix.vscode_arch == 'x64' }} - run: tar -czf package.tar.gz release if: ${{ matrix.vscode_arch == 'x64' }} - - run: | - sed "/^## Unreleased/,/^## / ! d" CHANGELOG.md | head -n -2 | tail -n +3 > .cache/release-notes - if: ${{ matrix.vscode_arch == 'x64' }} - - uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 + - run: mkdir -p release-files && cp package.tar.gz release-files/ if: ${{ matrix.vscode_arch == 'x64' }} - with: - draft: true - files: package.tar.gz - tag_name: v${{ env.VERSION }} - name: v${{ env.VERSION }} - body_path: .cache/release-notes # Platform-specific release. - run: KEEP_MODULES=1 npm run release - run: npm run package - - uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 + - run: mkdir -p release-files && cp release-packages/* release-files/ + + # The approve job and publish.yaml check every file against these. + - uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 with: - draft: true - files: ./release-packages/* - tag_name: v${{ env.VERSION }} - name: v${{ env.VERSION }} + subject-path: release-files/* + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: ${{ format('release-linux-{0}', matrix.vscode_arch) }} + path: release-files/* + if-no-files-found: error package-macos: name: ${{ matrix.vscode_target }} runs-on: ${{ matrix.os }} - if: >- - (github.event_name == 'workflow_dispatch') || - (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true && startsWith(github.head_ref, 'update/')) + needs: prepare + permissions: + contents: read + id-token: write # To sign the provenance attestations. + attestations: write strategy: matrix: include: @@ -147,7 +224,7 @@ jobs: env: VSCODE_TARGET: ${{ matrix.vscode_target }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAG: ${{ inputs.version || github.event.pull_request.head.ref || github.ref_name }} + VERSION: ${{ needs.prepare.outputs.version }} # Ensure native modules are built from source to avoid prebuilds. npm_config_build_from_source: true @@ -163,18 +240,13 @@ jobs: curl -sSfL https://github.com/goreleaser/nfpm/releases/download/v2.3.1/nfpm_2.3.1_`uname -s`_`uname -m`.tar.gz | tar -C ~/.local/bin -zxv nfpm echo "$HOME/.local/bin" >> $GITHUB_PATH - - name: Strip update/ and v from tag and set major version - run: | - version=${TAG#update/} - version=${version#v} - version=4${version:1} - echo "VERSION=$version" >> $GITHUB_ENV - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 with: + # The commit prepare checked is on main, never a PR head. + ref: ${{ needs.prepare.outputs.commit }} submodules: true - # When an update/ branch is merged, a release is automatically created - # which requires secrets. + persist-credentials: false + # A merged update/ PR starts a release through pull_request_target. allow-unsafe-pr-checkout: true - run: quilt push -a - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v6 @@ -192,19 +264,26 @@ jobs: - run: npm run test:native - run: npm run package - - uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 + - run: mkdir -p release-files && cp release-packages/* release-files/ + + # The approve job and publish.yaml check every file against these. + - uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 with: - draft: true - files: ./release-packages/* - tag_name: v${{ env.VERSION }} - name: v${{ env.VERSION }} + subject-path: release-files/* + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: ${{ format('release-{0}', matrix.vscode_target) }} + path: release-files/* + if-no-files-found: error package-windows: name: win32-x64 runs-on: windows-2022 - if: >- - (github.event_name == 'workflow_dispatch') || - (github.event_name == 'pull_request_target' && github.event.pull_request.merged == true && startsWith(github.head_ref, 'update/')) + needs: prepare + permissions: + contents: read + id-token: write # To sign the provenance attestations. + attestations: write defaults: run: @@ -213,7 +292,7 @@ jobs: env: VSCODE_TARGET: win32-x64 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - TAG: ${{ inputs.version || github.event.pull_request.head.ref || github.ref_name }} + VERSION: ${{ needs.prepare.outputs.version }} # Ensure native modules are built from source to avoid prebuilds. npm_config_build_from_source: true OS: windows @@ -225,18 +304,13 @@ jobs: - name: Keep line endings as they are in the repository run: git config --global core.autocrlf false - - name: Strip update/ and v from tag and set major version - run: | - version=${TAG#update/} - version=${version#v} - version=4${version:1} - echo "VERSION=$version" >> $GITHUB_ENV - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 with: + # The commit prepare checked is on main, never a PR head. + ref: ${{ needs.prepare.outputs.commit }} submodules: true - # When an update/ branch is merged, a release is automatically created - # which requires secrets. + persist-credentials: false + # A merged update/ PR starts a release through pull_request_target. allow-unsafe-pr-checkout: true # quilt has no windows build. The patches are ordinary -p1 diffs @@ -343,9 +417,152 @@ jobs: esac npm run package - - uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 + - run: mkdir -p release-files && cp release-packages/* release-files/ + + # The approve job and publish.yaml check every file against these. + - uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 + with: + subject-path: release-files/* + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: release-win32-x64 + path: release-files/* + if-no-files-found: error + + approve: + name: Approve, tag and publish the release + needs: [prepare, package-linux, package-macos, package-windows] + runs-on: ubuntu-24.04 + # A member of code-server-release-team other than the person who started the run approves + # here. Only this job of main's copy of this file, in this environment, may sign as + # coder-release-publisher, the only actor the "Release tags (App only)" ruleset lets create + # tags. + environment: release-approval + permissions: + contents: read + id-token: write # Cloud KMS signs the App's JWT. + attestations: read + env: + VERSION: ${{ needs.prepare.outputs.version }} + COMMIT: ${{ needs.prepare.outputs.commit }} + PRERELEASE: ${{ needs.prepare.outputs.prerelease }} + steps: + # For the tags, the history of main and the changelog. Nothing from the tree runs here. + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 + with: + fetch-depth: 0 + fetch-tags: true + persist-credentials: false + # A merged update/ PR starts a release through pull_request_target. This checks out + # main, not the PR head. + allow-unsafe-pr-checkout: true + + # Here and not in prepare, because the tags can change while the run waits for approval. + - name: Check the tag + id: check + run: | + set -euo pipefail + fail() { echo "::error::$*"; exit 1; } + tag="v$VERSION" + + git merge-base --is-ancestor "$COMMIT" origin/main || fail "$COMMIT is not on main." + + # A re-run finds the tag the first attempt created. + if existing="$(git rev-parse --verify --quiet "refs/tags/$tag^{commit}")"; then + [[ "$existing" == "$COMMIT" ]] || fail "Tag $tag already exists at $existing, not at $COMMIT." + echo "Tag $tag already exists at $COMMIT." + echo "create_tag=false" >> "$GITHUB_OUTPUT" + else + # Versions only go up, and a release never comes from before the last one. + latest="$(git tag --list 'v*' --sort=-version:refname | grep -E -m 1 '^v[0-9]+\.[0-9]+\.[0-9]+$' || true)" + if [[ -n "$latest" ]]; then + printf '%s\n' "${latest#v}" "${VERSION%%-*}" | sort -V -C || fail "$tag is not newer than $latest, the latest release." + [[ "${VERSION%%-*}" != "${latest#v}" ]] || fail "$latest is already released." + git merge-base --is-ancestor "$latest" "$COMMIT" || fail "$COMMIT is older than the commit released as $latest." + fi + echo "create_tag=true" >> "$GITHUB_OUTPUT" + fi + + # The release notes are the changelog's Unreleased section at the released commit. + mkdir -p "$RUNNER_TEMP/notes" + git show "$COMMIT:CHANGELOG.md" | sed "/^## Unreleased/,/^## / ! d" | head -n -2 | tail -n +3 > "$RUNNER_TEMP/notes/release-notes.md" + + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: - draft: true - files: ./release-packages/* - tag_name: v${{ env.VERSION }} - name: v${{ env.VERSION }} + pattern: release-* + path: release-files + merge-multiple: true + + # Every file must have been built and attested by this workflow, from main. + - name: Verify the files + env: + GH_TOKEN: ${{ github.token }} + run: | + set -euo pipefail + shopt -s nullglob + files=(release-files/*) + [[ ${#files[@]} -gt 0 ]] || { echo "::error::No release files were built."; exit 1; } + for f in "${files[@]}"; do + gh attestation verify "$f" \ + --repo "$GITHUB_REPOSITORY" \ + --signer-workflow "$GITHUB_REPOSITORY/.github/workflows/release.yaml" \ + --source-ref refs/heads/main \ + --deny-self-hosted-runners + done + sha256sum "${files[@]}" | tee "$RUNNER_TEMP/notes/SHA256SUMS" + + - name: Generate release App token + id: app_token + uses: coder/github-app-token-action@00eaec58ee1bfea9c8b48655b7ab7470b07739e5 # main 2026-11-17 + with: + client-id: ${{ secrets.CODER_RELEASE_PUBLISHER_APP_ID }} + kms-key: ${{ secrets.CODER_RELEASE_PUBLISHER_APP_KMS_KEY }} + workload-identity-provider: ${{ secrets.APP_KEYS_WORKLOAD_ID_PROVIDER }} + owner: coder + repositories: code-server + permissions: | + contents: write + workflows: write + + # An annotated tag, through the API: nothing is pushed from this job's checkout. + - name: Create the tag + if: ${{ steps.check.outputs.create_tag == 'true' }} + env: + GH_TOKEN: ${{ steps.app_token.outputs.token }} + run: | + set -euo pipefail + tag="v$VERSION" + tag_object="$(gh api "repos/$GITHUB_REPOSITORY/git/tags" \ + -f tag="$tag" -f message="Release $tag" -f object="$COMMIT" -f type=commit \ + --jq .sha)" + gh api "repos/$GITHUB_REPOSITORY/git/refs" -f ref="refs/tags/$tag" -f sha="$tag_object" >/dev/null + echo "Created tag $tag at $COMMIT." + + # gh uploads the files to a new release and publishes it in the same command. The repository + # has immutable releases, so the files and the tag are fixed from then on. Publishing a + # (non-pre-)release starts publish.yaml. + - name: Publish the release + env: + GH_TOKEN: ${{ steps.app_token.outputs.token }} + run: | + set -euo pipefail + tag="v$VERSION" + if gh release view "$tag" --repo "$GITHUB_REPOSITORY" --json isDraft --jq .isDraft 2>/dev/null | grep -qx false; then + echo "Release $tag is already published." + exit 0 + fi + # A draft for this tag is left over from an attempt that stopped before publishing. Only + # this job's own drafts are replaced; anything else needs a person to look at it. + gh api "repos/$GITHUB_REPOSITORY/releases" --paginate \ + --jq ".[] | select(.draft and .tag_name == \"$tag\") | \"\(.id) \(.author.login)\"" | + while read -r id author; do + [[ "$author" == "coder-release-publisher[bot]" ]] || { echo "::error::Draft release $id for $tag was made by $author. Delete it, then re-run."; exit 1; } + gh api -X DELETE "repos/$GITHUB_REPOSITORY/releases/$id" + echo "Deleted the unfinished draft $id for $tag." + done + args=(--repo "$GITHUB_REPOSITORY" --verify-tag --title "$tag" --notes-file "$RUNNER_TEMP/notes/release-notes.md") + if [[ "$PRERELEASE" == "true" ]]; then + args+=(--prerelease) + fi + gh release create "$tag" "${args[@]}" release-files/* + echo "Published https://github.com/$GITHUB_REPOSITORY/releases/tag/$tag" diff --git a/docs/MAINTAINING.md b/docs/MAINTAINING.md index 69263576ec2c..6971175c75e8 100644 --- a/docs/MAINTAINING.md +++ b/docs/MAINTAINING.md @@ -24,17 +24,33 @@ Most of the work is keeping on top of issues and discussions. ## Releasing -1. Check that the changelog lists all the important changes. +A release takes two people: one starts it, and a member of +`code-server-release-team` other than that person approves it. Nobody pushes a +tag or edits a draft release: the release workflow creates the tag and publishes +the release itself, once it is approved, and releases cannot be changed after +that. + +1. Check that the changelog lists all the important changes. The release notes + are the changelog's `Unreleased` section at the released commit, so get them + right in a PR before releasing. 2. Make sure the changelog entry lists the current version of VS Code. -3. Go to GitHub Actions > Draft release > Run workflow on the commit you want to - release. For the version we match VS Code's minor and patch version. The - patch number may become temporarily out of sync if we need to put out a - patch, but if we make our own minor change then we will not release it until - the next minor VS Code release. -4. CI will build an NPM package and platform-specific packages, and upload those - to a draft release. -5. Update the resulting draft release with the changelog contents. -6. Publish the draft release after validating it. +3. Start the release, either way: + - Merge the `update/` PR. Merging it starts the Release + workflow on the merge commit. + - Or go to GitHub Actions > Release > Run workflow on `main`, with the version + and the full SHA of the commit on `main` to release. For the version we + match VS Code's minor and patch version. The patch number may become + temporarily out of sync if we need to put out a patch, but if we make our + own minor change then we will not release it until the next minor VS Code + release. +4. CI builds the NPM package and the platform-specific packages from that + commit, and attests each file's provenance. +5. A member of `code-server-release-team` other than the person who started the + release reviews the run and approves the `release-approval` deployment. +6. The workflow then tags the commit and publishes the release with the built + files. Publishing starts the publish workflow (npm, Docker Hub, GHCR and the + AUR PR). It checks that the release came from the release workflow, and every + file's attestation, before it publishes anything. 7. Update the changelog with the release date and bump the Helm chart version once the Docker images have published. 8. Merge the PR submitted to coder/code-server-aur repo. @@ -44,10 +60,10 @@ Most of the work is keeping on top of issues and discussions. We prefer to do release candidates so the community can test things before a full-blown release. To do this follow the same steps as above but: -1. Add a `-rc.` suffix to the version. -2. When you publish the release select "pre-release". CI will not automatically - publish pre-releases. -3. Do not update the chart version or merge in the changelog until the final +1. Run the Release workflow by hand with a `-rc.` suffix on the version + and "pre-release" checked. CI will not publish pre-releases to npm, Docker or + the AUR. +2. Do not update the chart version or merge in the changelog until the final release. #### AUR From 8ea541157362195d4fa9287f4dae012bcf984254 Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Wed, 18 Nov 2026 19:50:09 -0500 Subject: [PATCH 2/3] ci: upload release-packages directly instead of copying it package.tar.gz is now written into release-packages next to the platform packages, so every build job attests and uploads one flat directory without a copy. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yaml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5d06ce2cbfdc..aa22c1693059 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -186,24 +186,22 @@ jobs: # Platform-agnostic NPM package. - run: npm run release if: ${{ matrix.vscode_arch == 'x64' }} - - run: tar -czf package.tar.gz release - if: ${{ matrix.vscode_arch == 'x64' }} - - run: mkdir -p release-files && cp package.tar.gz release-files/ + # Into release-packages with the platform packages, so the artifact is one flat directory. + - run: mkdir -p release-packages && tar -czf release-packages/package.tar.gz release if: ${{ matrix.vscode_arch == 'x64' }} # Platform-specific release. - run: KEEP_MODULES=1 npm run release - run: npm run package - - run: mkdir -p release-files && cp release-packages/* release-files/ # The approve job and publish.yaml check every file against these. - uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 with: - subject-path: release-files/* + subject-path: release-packages/* - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: ${{ format('release-linux-{0}', matrix.vscode_arch) }} - path: release-files/* + path: release-packages/* if-no-files-found: error package-macos: @@ -264,16 +262,15 @@ jobs: - run: npm run test:native - run: npm run package - - run: mkdir -p release-files && cp release-packages/* release-files/ # The approve job and publish.yaml check every file against these. - uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 with: - subject-path: release-files/* + subject-path: release-packages/* - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: ${{ format('release-{0}', matrix.vscode_target) }} - path: release-files/* + path: release-packages/* if-no-files-found: error package-windows: @@ -417,16 +414,15 @@ jobs: esac npm run package - - run: mkdir -p release-files && cp release-packages/* release-files/ # The approve job and publish.yaml check every file against these. - uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 with: - subject-path: release-files/* + subject-path: release-packages/* - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: release-win32-x64 - path: release-files/* + path: release-packages/* if-no-files-found: error approve: From 8ddb9392b51034b6f8606cb0b1971840d75b378d Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Wed, 18 Nov 2026 19:52:03 -0500 Subject: [PATCH 3/3] ci: remove a doubled blank line in release.yaml Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index aa22c1693059..36034e6d5975 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -414,7 +414,6 @@ jobs: esac npm run package - # The approve job and publish.yaml check every file against these. - uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 with: