Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}

Expand All @@ -26,6 +32,7 @@ concurrency:

jobs:
select-mode:
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -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
8 changes: 8 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading