From 2b33b1be7a73c5df30511ff877e09be5140328a1 Mon Sep 17 00:00:00 2001 From: Carlos Panato Date: Fri, 6 Nov 2026 13:41:18 +0100 Subject: [PATCH 1/5] ci: add verified GitHub releases and RC packages --- .github/workflows/ci.yml | 28 +++++++++++++-- .github/workflows/release.yml | 68 +++++++++++++++++++++++++++++++++++ README.md | 21 +++++++++-- package.json | 1 + scripts/package.sh | 11 ++++-- scripts/prepare-release.sh | 18 ++++++++++ tests/release.test.sh | 39 ++++++++++++++++++++ 7 files changed, 180 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 scripts/prepare-release.sh create mode 100644 tests/release.test.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4e24e2..afa6c15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,11 +5,17 @@ on: branches: - main pull_request: + workflow_call: + inputs: + release-tag: + description: Optional release tag to validate and stamp into the package + type: string + default: "" permissions: {} concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + group: verify-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: @@ -25,6 +31,15 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false + ref: ${{ inputs.release-tag || github.ref }} + + - name: Verify release tag points to the checked-out commit + if: inputs.release-tag != '' + env: + RELEASE_TAG: ${{ inputs.release-tag }} + run: | + [[ "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc\.[1-9][0-9]*)?$ ]] + test "$(git rev-parse HEAD)" = "$(git rev-parse "refs/tags/$RELEASE_TAG^{commit}")" - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: @@ -47,9 +62,18 @@ jobs: - name: Run unit tests run: npm test + - name: Test release validation and packaging + run: npm run test:release + - name: Build extension run: npm run build + - name: Prepare release metadata + if: inputs.release-tag != '' + env: + RELEASE_TAG: ${{ inputs.release-tag }} + run: bash scripts/prepare-release.sh "$RELEASE_TAG" + - name: Install test browser run: npm exec --no -- playwright install --with-deps chromium @@ -63,7 +87,7 @@ jobs: uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: github-status-extension - path: artifacts/*.zip + path: artifacts/* if-no-files-found: error retention-days: 14 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..49e9b43 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,68 @@ +name: Release + +on: + push: + tags: + - "v*" + workflow_dispatch: + inputs: + tag: + description: Existing release tag (vX.Y.Z or vX.Y.Z-rc.N) + required: true + type: string + +permissions: {} + +concurrency: + group: release-${{ inputs.tag || github.ref_name }} + cancel-in-progress: false + +jobs: + verify: + name: Verify release + permissions: + contents: read + uses: ./.github/workflows/ci.yml + with: + release-tag: ${{ inputs.tag || github.ref_name }} + + publish: + name: Publish GitHub release + needs: verify + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + contents: write + steps: + - name: Download verified release assets + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + with: + name: github-status-extension + path: artifacts + + - name: Verify package checksum + working-directory: artifacts + run: shasum -a 256 -c ./*.sha256 + + - name: Create release + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + RELEASE_TAG: ${{ inputs.tag || github.ref_name }} + run: | + [[ "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc\.[1-9][0-9]*)?$ ]] + release_flags=(--latest=false) + if [[ "$RELEASE_TAG" == *-rc.* ]]; then + release_flags+=(--prerelease) + else + release_flags=(--latest) + fi + cat > "$RUNNER_TEMP/release-notes.md" <<'NOTES' + Download the ZIP and its SHA-256 checksum below. Extract the ZIP to a folder, open chrome://extensions, enable Developer mode, and choose Load unpacked to select that folder. + + This release is for manual installation. It is not published to the Chrome Web Store. GitHub is the only supported provider in this version. + NOTES + gh release create "$RELEASE_TAG" artifacts/* \ + --verify-tag --title "$RELEASE_TAG" \ + --notes-file "$RUNNER_TEMP/release-notes.md" \ + --generate-notes "${release_flags[@]}" diff --git a/README.md b/README.md index 778f8c2..869a207 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The first version includes the overall status, affected-first service list, acti ## Build and install -Requires Node.js 26 LTS or newer and npm. The `.nvmrc` file selects Node 26 for local development and CI; run `nvm install && nvm use` if you use nvm. Bash and zip are used for packaging. +Requires Node.js 26 LTS or newer and npm. The `.nvmrc` file selects Node 26 for local development and CI; run `nvm install && nvm use` if you use nvm. Bash, jq, zip, and shasum are used for packaging. ```bash npm ci --ignore-scripts @@ -19,7 +19,23 @@ Open `chrome://extensions`, enable **Developer mode**, choose **Load unpacked**, npm run package ``` -The distributable is `artifacts/github-status-extension-0.1.0.zip`. It contains compiled extension code and assets only. It is not automatically published to the Chrome Web Store. +The distributable is `artifacts/github-status-extension-0.1.0.zip`, accompanied by a `.zip.sha256` checksum. It contains compiled extension code and assets only. It is not automatically published to the Chrome Web Store. + +## Releases and release candidates + +Push a tag matching the version in both `package.json` and `public/manifest.json`: `v0.1.0` for a stable release, or `v0.1.0-rc.1` for a release candidate. The Release workflow runs the full CI, stamps `version_name` into the built manifest, and publishes the ZIP and SHA-256 checksum to GitHub Releases. RC tags are marked as prereleases and do not become the latest stable release. Chrome's numeric `version` remains `0.1.0` for this release series. + +The workflow can also be run manually with an existing tag. It verifies the tag points at the checked-out source and refuses version mismatches. Only the publishing job has repository write permissions; it downloads the tested artifact and verifies the checksum without checking out or executing project code. Existing release assets are not overwritten automatically. + +To test a published RC, download and extract its ZIP, open `chrome://extensions`, enable **Developer mode**, and choose **Load unpacked** with the extracted directory. To verify the download, put the ZIP and checksum in the same directory and run `shasum -a 256 -c github-status-extension-0.1.0-rc.1.zip.sha256`. + +To prepare an RC locally without publishing: + +```bash +npm run build +bash scripts/prepare-release.sh v0.1.0-rc.1 +bash scripts/package.sh +``` ## Validation @@ -27,6 +43,7 @@ The distributable is `artifacts/github-status-extension-0.1.0.zip`. It contains npm run typecheck npm run lint npm test +npm run test:release npm run build npx playwright install chromium npm run test:e2e diff --git a/package.json b/package.json index bd6a264..ca4afdd 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "build": "bash scripts/build.sh", "test": "tsc -p tsconfig.test.json && node --test .test/tests/*.test.js", "test:e2e": "playwright test", + "test:release": "bash tests/release.test.sh", "package": "npm run build && bash scripts/package.sh" }, "devDependencies": { diff --git a/scripts/package.sh b/scripts/package.sh index 7efe9fa..7a81e4f 100644 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -1,6 +1,13 @@ #!/usr/bin/env bash set -euo pipefail cd "$(dirname "$0")/.." +package_version=$(jq -er '.version_name // .version' dist/manifest.json) +if [[ ! "$package_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-rc\.[1-9][0-9]*)?$ ]]; then + echo 'Invalid package version' >&2 + exit 1 +fi mkdir -p artifacts -rm -f artifacts/github-status-extension-0.1.0.zip -(cd dist && zip -qr ../artifacts/github-status-extension-0.1.0.zip .) +archive="github-status-extension-$package_version.zip" +rm -f "artifacts/$archive" +(cd dist && zip -qr "../artifacts/$archive" .) +(cd artifacts && shasum -a 256 "$archive" > "$archive.sha256") diff --git a/scripts/prepare-release.sh b/scripts/prepare-release.sh new file mode 100644 index 0000000..a3a89e6 --- /dev/null +++ b/scripts/prepare-release.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -euo pipefail +cd "$(dirname "$0")/.." +release_tag=${1:?Usage: prepare-release.sh vX.Y.Z[-rc.N]} +if [[ ! "$release_tag" =~ ^v([0-9]+\.[0-9]+\.[0-9]+)(-rc\.[1-9][0-9]*)?$ ]]; then + echo 'Expected a tag in the form vX.Y.Z or vX.Y.Z-rc.N' >&2 + exit 1 +fi +base_version=${BASH_REMATCH[1]} +package_version=$(jq -er .version package.json) +manifest_version=$(jq -er .version dist/manifest.json) +if [[ "$package_version" != "$base_version" || "$manifest_version" != "$base_version" ]]; then + echo 'Tag, package.json, and manifest.json versions must match' >&2 + exit 1 +fi +# Chrome requires a numeric version; version_name carries the RC suffix. +jq --arg version "${release_tag#v}" '.version_name = $version' dist/manifest.json > dist/manifest.release.json +mv dist/manifest.release.json dist/manifest.json diff --git a/tests/release.test.sh b/tests/release.test.sh new file mode 100644 index 0000000..8257bfb --- /dev/null +++ b/tests/release.test.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +set -euo pipefail +project_dir=$(cd "$(dirname "$0")/.." && pwd) +test_dir=$(mktemp -d) +trap 'rm -rf "$test_dir"' EXIT +mkdir -p "$test_dir/scripts" "$test_dir/dist" +cp "$project_dir/scripts/prepare-release.sh" "$project_dir/scripts/package.sh" "$test_dir/scripts/" +printf '{"version":"0.1.0"}\n' > "$test_dir/package.json" +printf '{"version":"0.1.0","manifest_version":3}\n' > "$test_dir/dist/manifest.json" +cd "$test_dir" +for invalid in 'v0.1.0-rc.0' 'v0.1.0-beta.1' '0.1.0' 'v0.2.0' 'v0.1.0/../../x' 'v0.1.0;echo bad'; do + if bash scripts/prepare-release.sh "$invalid" >/dev/null 2>&1; then + echo "Unexpectedly accepted invalid release tag: $invalid" >&2 + exit 1 + fi +done +test "$(jq -r '.version_name // "missing"' dist/manifest.json)" = missing +bash scripts/prepare-release.sh v0.1.0-rc.1 +test "$(jq -r .version dist/manifest.json)" = 0.1.0 +test "$(jq -r .version_name dist/manifest.json)" = 0.1.0-rc.1 +bash scripts/package.sh +(cd artifacts && shasum -a 256 -c github-status-extension-0.1.0-rc.1.zip.sha256) +test "$(unzip -p artifacts/github-status-extension-0.1.0-rc.1.zip manifest.json | jq -r .version_name)" = 0.1.0-rc.1 +bash scripts/prepare-release.sh v0.1.0 +bash scripts/package.sh +test -f artifacts/github-status-extension-0.1.0.zip +jq '.version = "0.2.0"' dist/manifest.json > dist/mismatch.json +mv dist/mismatch.json dist/manifest.json +if bash scripts/prepare-release.sh v0.1.0 >/dev/null 2>&1; then + echo 'Unexpectedly accepted mismatched manifest version' >&2 + exit 1 +fi +jq '.version_name = "../../bad"' dist/manifest.json > dist/invalid.json +mv dist/invalid.json dist/manifest.json +if bash scripts/package.sh >/dev/null 2>&1; then + echo 'Unexpectedly accepted invalid package filename' >&2 + exit 1 +fi +echo 'Release validation and packaging tests passed.' From 936b1ab15ec4010ebc4f2d2195c6222fa1e3938f Mon Sep 17 00:00:00 2001 From: Carlos Panato Date: Fri, 6 Nov 2026 13:42:47 +0100 Subject: [PATCH 2/5] ci: trigger releases exclusively on version tags --- .github/workflows/release.yml | 12 +++--------- README.md | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 49e9b43..14d487e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,17 +4,11 @@ on: push: tags: - "v*" - workflow_dispatch: - inputs: - tag: - description: Existing release tag (vX.Y.Z or vX.Y.Z-rc.N) - required: true - type: string permissions: {} concurrency: - group: release-${{ inputs.tag || github.ref_name }} + group: release-${{ github.ref_name }} cancel-in-progress: false jobs: @@ -24,7 +18,7 @@ jobs: contents: read uses: ./.github/workflows/ci.yml with: - release-tag: ${{ inputs.tag || github.ref_name }} + release-tag: ${{ github.ref_name }} publish: name: Publish GitHub release @@ -48,7 +42,7 @@ jobs: env: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} - RELEASE_TAG: ${{ inputs.tag || github.ref_name }} + RELEASE_TAG: ${{ github.ref_name }} run: | [[ "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc\.[1-9][0-9]*)?$ ]] release_flags=(--latest=false) diff --git a/README.md b/README.md index 869a207..c8c4d7a 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ The distributable is `artifacts/github-status-extension-0.1.0.zip`, accompanied Push a tag matching the version in both `package.json` and `public/manifest.json`: `v0.1.0` for a stable release, or `v0.1.0-rc.1` for a release candidate. The Release workflow runs the full CI, stamps `version_name` into the built manifest, and publishes the ZIP and SHA-256 checksum to GitHub Releases. RC tags are marked as prereleases and do not become the latest stable release. Chrome's numeric `version` remains `0.1.0` for this release series. -The workflow can also be run manually with an existing tag. It verifies the tag points at the checked-out source and refuses version mismatches. Only the publishing job has repository write permissions; it downloads the tested artifact and verifies the checksum without checking out or executing project code. Existing release assets are not overwritten automatically. +The dedicated Release workflow runs only when a version tag is pushed; it has no manual trigger. It verifies the tag points at the checked-out source and refuses version mismatches. Only the publishing job has repository write permissions; it downloads the tested artifact and verifies the checksum without checking out or executing project code. Existing release assets are not overwritten automatically. To test a published RC, download and extract its ZIP, open `chrome://extensions`, enable **Developer mode**, and choose **Load unpacked** with the extracted directory. To verify the download, put the ZIP and checksum in the same directory and run `shasum -a 256 -c github-status-extension-0.1.0-rc.1.zip.sha256`. From 0e7621aaec320d0c0e8a015133b58791af265639 Mon Sep 17 00:00:00 2001 From: Carlos Panato Date: Fri, 6 Nov 2026 13:44:59 +0100 Subject: [PATCH 3/5] ci: make tag release workflow fully independent --- .github/workflows/ci.yml | 28 +----------- .github/workflows/release.yml | 80 ++++++++++++++++++++++++++++++++--- README.md | 2 +- 3 files changed, 77 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afa6c15..a4e24e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,17 +5,11 @@ on: branches: - main pull_request: - workflow_call: - inputs: - release-tag: - description: Optional release tag to validate and stamp into the package - type: string - default: "" permissions: {} concurrency: - group: verify-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: @@ -31,15 +25,6 @@ jobs: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - ref: ${{ inputs.release-tag || github.ref }} - - - name: Verify release tag points to the checked-out commit - if: inputs.release-tag != '' - env: - RELEASE_TAG: ${{ inputs.release-tag }} - run: | - [[ "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc\.[1-9][0-9]*)?$ ]] - test "$(git rev-parse HEAD)" = "$(git rev-parse "refs/tags/$RELEASE_TAG^{commit}")" - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: @@ -62,18 +47,9 @@ jobs: - name: Run unit tests run: npm test - - name: Test release validation and packaging - run: npm run test:release - - name: Build extension run: npm run build - - name: Prepare release metadata - if: inputs.release-tag != '' - env: - RELEASE_TAG: ${{ inputs.release-tag }} - run: bash scripts/prepare-release.sh "$RELEASE_TAG" - - name: Install test browser run: npm exec --no -- playwright install --with-deps chromium @@ -87,7 +63,7 @@ jobs: uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: github-status-extension - path: artifacts/* + path: artifacts/*.zip if-no-files-found: error retention-days: 14 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14d487e..eada251 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,17 +12,85 @@ concurrency: cancel-in-progress: false jobs: - verify: - name: Verify release + build: + name: Verify and build release + runs-on: ubuntu-latest + timeout-minutes: 15 permissions: contents: read - uses: ./.github/workflows/ci.yml - with: - release-tag: ${{ github.ref_name }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Verify release tag + env: + RELEASE_TAG: ${{ github.ref_name }} + run: | + [[ "$RELEASE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-rc\.[1-9][0-9]*)?$ ]] + test "$(git rev-parse HEAD)" = "$(git rev-parse "refs/tags/$RELEASE_TAG^{commit}")" + + - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 + with: + node-version-file: .nvmrc + check-latest: true + cache: npm + + - name: Install dependencies without lifecycle scripts + run: npm ci --ignore-scripts + + - name: Audit dependencies + run: npm audit --audit-level=moderate + + - name: Type-check + run: npm run typecheck + + - name: Check formatting + run: npm run lint + + - name: Run unit tests + run: npm test + + - name: Test release validation and packaging + run: npm run test:release + + - name: Build extension + run: npm run build + + - name: Prepare release metadata + env: + RELEASE_TAG: ${{ github.ref_name }} + run: bash scripts/prepare-release.sh "$RELEASE_TAG" + + - name: Install test browser + run: npm exec --no -- playwright install --with-deps chromium + + - name: Run Chromium extension tests + run: npm run test:e2e + + - name: Package extension + run: bash scripts/package.sh + + - name: Upload verified release assets + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: github-status-extension + path: artifacts/* + if-no-files-found: error + retention-days: 14 + + - name: Upload browser failure diagnostics + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + if: failure() + with: + name: browser-test-results + path: test-results/ + if-no-files-found: ignore + retention-days: 7 publish: name: Publish GitHub release - needs: verify + needs: build runs-on: ubuntu-latest timeout-minutes: 5 permissions: diff --git a/README.md b/README.md index c8c4d7a..9737d61 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ The distributable is `artifacts/github-status-extension-0.1.0.zip`, accompanied ## Releases and release candidates -Push a tag matching the version in both `package.json` and `public/manifest.json`: `v0.1.0` for a stable release, or `v0.1.0-rc.1` for a release candidate. The Release workflow runs the full CI, stamps `version_name` into the built manifest, and publishes the ZIP and SHA-256 checksum to GitHub Releases. RC tags are marked as prereleases and do not become the latest stable release. Chrome's numeric `version` remains `0.1.0` for this release series. +Push a tag matching the version in both `package.json` and `public/manifest.json`: `v0.1.0` for a stable release, or `v0.1.0-rc.1` for a release candidate. The dedicated Release workflow runs its own validation, tests, and build without calling CI, stamps `version_name` into the built manifest, and publishes the ZIP and SHA-256 checksum to GitHub Releases. RC tags are marked as prereleases and do not become the latest stable release. Chrome's numeric `version` remains `0.1.0` for this release series. The dedicated Release workflow runs only when a version tag is pushed; it has no manual trigger. It verifies the tag points at the checked-out source and refuses version mismatches. Only the publishing job has repository write permissions; it downloads the tested artifact and verifies the checksum without checking out or executing project code. Existing release assets are not overwritten automatically. From 1f8fe4c92122776c9ff9c6c8754dee96b369a619 Mon Sep 17 00:00:00 2001 From: Carlos Panato Date: Fri, 6 Nov 2026 13:46:41 +0100 Subject: [PATCH 4/5] test: update Playwright to fix browser installation on Node 26 --- package-lock.json | 48 +++++++++++++++-------------------------------- package.json | 2 +- 2 files changed, 16 insertions(+), 34 deletions(-) diff --git a/package-lock.json b/package-lock.json index efa09e5..853b384 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "name": "github-status-extension", "version": "0.1.0", "devDependencies": { - "@playwright/test": "1.56.1", + "@playwright/test": "1.65.0", "@types/chrome": "0.1.24", "@types/node": "24.10.0", "prettier": "3.6.2", @@ -19,19 +19,19 @@ } }, "node_modules/@playwright/test": { - "version": "1.56.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.56.1.tgz", - "integrity": "sha512-vSMYtL/zOcFpvJCW71Q/OEGQb7KYBPAdKh35WNSkaZA75JlAO8ED8UN6GUNTm3drWomcbcqRPFqQbLae8yBTdg==", + "version": "1.65.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.65.0.tgz", + "integrity": "sha512-iGURLGuKDLakSEl7Pgfv8h7f+XLT+V861Wfhz0zlEl5nyFuKUopdkFBPKqTllTUp06aOwPuH8iuUEb3yp3MpbQ==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright": "1.56.1" + "playwright": "1.65.0" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/@types/chrome": { @@ -79,51 +79,33 @@ "undici-types": "~7.16.0" } }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/playwright": { - "version": "1.56.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.1.tgz", - "integrity": "sha512-aFi5B0WovBHTEvpM3DzXTUaeN6eN0qWnTkKx4NQaH4Wvcmc153PdaY2UBdSYKaGYw+UyWXSVyxDUg5DoPEttjw==", + "version": "1.65.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.65.0.tgz", + "integrity": "sha512-F3AMWcR44qMBt4kq+6Kb6mX7bjGXshktKFOPULd7reED6ZJWevjbNRqysP7q+AATE9kdPEZBibex1BYsvpVoeA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.56.1" + "playwright-core": "1.65.0" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=18" - }, - "optionalDependencies": { - "fsevents": "2.3.2" + "node": ">=20" } }, "node_modules/playwright-core": { - "version": "1.56.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.1.tgz", - "integrity": "sha512-hutraynyn31F+Bifme+Ps9Vq59hKuUCz7H1kDOcBs+2oGguKkWTU50bBWrtz34OUWmIwpBTWDxaRPXrIXkgvmQ==", + "version": "1.65.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.0.tgz", + "integrity": "sha512-vNSKgH6YqtN7cdT/L334zo0a+YwkrpicyrHJlWWPIm/Q+Nn2SWInil01oT0mbu96U4GgoRtCYQD9CzJQgju+lA==", "dev": true, "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=18" + "node": ">=20" } }, "node_modules/prettier": { diff --git a/package.json b/package.json index ca4afdd..28f885e 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "package": "npm run build && bash scripts/package.sh" }, "devDependencies": { - "@playwright/test": "1.56.1", + "@playwright/test": "1.65.0", "@types/chrome": "0.1.24", "@types/node": "24.10.0", "prettier": "3.6.2", From df97e462ca83556119c714d29138bb12e770663b Mon Sep 17 00:00:00 2001 From: Carlos Panato Date: Fri, 6 Nov 2026 13:50:29 +0100 Subject: [PATCH 5/5] ci: publish immutable releases only after asset verification --- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++-- README.md | 4 +++- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eada251..537eca3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -106,7 +106,7 @@ jobs: working-directory: artifacts run: shasum -a 256 -c ./*.sha256 - - name: Create release + - name: Create draft release env: GH_TOKEN: ${{ github.token }} GH_REPO: ${{ github.repository }} @@ -124,7 +124,36 @@ jobs: This release is for manual installation. It is not published to the Chrome Web Store. GitHub is the only supported provider in this version. NOTES - gh release create "$RELEASE_TAG" artifacts/* \ + gh release create "$RELEASE_TAG" --draft \ --verify-tag --title "$RELEASE_TAG" \ --notes-file "$RUNNER_TEMP/release-notes.md" \ --generate-notes "${release_flags[@]}" + + - name: Upload all release assets before publication + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + RELEASE_TAG: ${{ github.ref_name }} + run: gh release upload "$RELEASE_TAG" artifacts/* + + - name: Verify uploaded assets + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + RELEASE_TAG: ${{ github.ref_name }} + run: | + gh release download "$RELEASE_TAG" --pattern '*.zip' --pattern '*.sha256' --dir "$RUNNER_TEMP/release-verification" + cd "$RUNNER_TEMP/release-verification" + shasum -a 256 -c ./*.sha256 + + - name: Publish immutable release + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + RELEASE_TAG: ${{ github.ref_name }} + run: | + latest=true + if [[ "$RELEASE_TAG" == *-rc.* ]]; then + latest=false + fi + gh release edit "$RELEASE_TAG" --draft=false --latest="$latest" diff --git a/README.md b/README.md index 9737d61..baada4f 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,9 @@ The distributable is `artifacts/github-status-extension-0.1.0.zip`, accompanied Push a tag matching the version in both `package.json` and `public/manifest.json`: `v0.1.0` for a stable release, or `v0.1.0-rc.1` for a release candidate. The dedicated Release workflow runs its own validation, tests, and build without calling CI, stamps `version_name` into the built manifest, and publishes the ZIP and SHA-256 checksum to GitHub Releases. RC tags are marked as prereleases and do not become the latest stable release. Chrome's numeric `version` remains `0.1.0` for this release series. -The dedicated Release workflow runs only when a version tag is pushed; it has no manual trigger. It verifies the tag points at the checked-out source and refuses version mismatches. Only the publishing job has repository write permissions; it downloads the tested artifact and verifies the checksum without checking out or executing project code. Existing release assets are not overwritten automatically. +The dedicated Release workflow runs only when a version tag is pushed; it has no manual trigger. It verifies the tag points at the checked-out source and refuses version mismatches. Only the publishing job has repository write permissions; it downloads the tested artifact and verifies the checksum without checking out or executing project code. + +The repository enables release immutability. Publication creates a draft, uploads every asset, downloads and verifies the uploaded package, and only then publishes the draft. Published assets and tags are never replaced. If publication fails, the release stays unpublished; fix the issue and cut a new RC instead of overwriting assets. Future cosign signatures must be included before publication. To test a published RC, download and extract its ZIP, open `chrome://extensions`, enable **Developer mode**, and choose **Load unpacked** with the extracted directory. To verify the download, put the ZIP and checksum in the same directory and run `shasum -a 256 -c github-status-extension-0.1.0-rc.1.zip.sha256`.