From ba2355f92a74590d8027c38d5a527fa2b1f8ce59 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 6 Oct 2026 22:30:45 +0200 Subject: [PATCH] ci: retry a failed registry release by hand A failed registry release cannot be re-run: the release service keys uploaded artifacts by workflow run ID, so a rerun's new attestation conflicts with the first attempt's (INVALID_REQUEST: Artifact upload is invalid, run 37486660259 attempt 2). Starting emdash-release.yml by hand would work, but the registry keeps one workflow connection per package, and approving one for emdash-release.yml replaces the connection for release.yml, so the next normal release would need another approval. release.yml now also runs on workflow_dispatch. On main it skips npm and calls emdash-release.yml with the version from package.json, so the run still comes from release.yml on refs/heads/main and matches the existing connection. No changeset: the package does not change. --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ AGENTS.md | 8 ++++++++ 2 files changed, 39 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f36264d..3ffd081 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,11 +13,17 @@ # from the lockfile's scripts and builds nothing: the pack job builds without # any credential and hands over tarballs. The publish job runs in the `npm` # environment, which the trusted publisher on npmjs.com requires. +# +# Run by hand on main, it skips npm and only publishes the version in +# package.json to the EmDash plugin registry, to retry a failed registry +# release. It has to run from this file: the registry's workflow connection +# names release.yml, and a run of emdash-release.yml would replace it. name: release on: push: branches: [main] + workflow_dispatch: permissions: {} @@ -26,6 +32,7 @@ concurrency: jobs: select-mode: + if: github.event_name == 'push' runs-on: ubuntu-latest permissions: contents: read @@ -131,3 +138,27 @@ jobs: contents: read id-token: write attestations: write + + registry-retry-version: + if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + permissions: + contents: read + outputs: + published-packages: ${{ steps.read.outputs.published-packages }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - id: read + run: echo "published-packages=$(jq -c '[{name, version}]' package.json)" >> "${GITHUB_OUTPUT}" + + registry-retry: + needs: registry-retry-version + uses: ./.github/workflows/emdash-release.yml + with: + published-packages: ${{ needs.registry-retry-version.outputs.published-packages }} + permissions: + contents: read + id-token: write + attestations: write diff --git a/AGENTS.md b/AGENTS.md index 4860819..512b953 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -115,5 +115,13 @@ holds `id-token`, and it installs and builds nothing. The npm publish job runs in the `npm` environment, which the npm trusted publisher requires. Keep both. +A failed registry release cannot be re-run: the release service keys the +uploaded artifacts by run, and a rerun's fresh attestation conflicts with the +first attempt's. Start `release.yml` by hand on main instead; it skips npm +and publishes the version in `package.json` to the registry. Never start +`emdash-release.yml` by hand: the registry keeps one workflow connection per +package, and approving one for `emdash-release.yml` replaces the one for +`release.yml`. + The repository installs with pnpm 11; `allowBuilds` in `pnpm-workspace.yaml` lets esbuild and workerd run their install scripts, which the test host needs.