From 91f349bef73331462ba841456293a296f3f72974 Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Sun, 16 Aug 2026 12:59:45 -0500 Subject: [PATCH] ci: publish to JSR from the same tag that publishes to npm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The @green-tea scope is claimed and the package is linked to this repository on jsr.io, so the OIDC id-token the job already holds for npm Trusted Publishing authenticates JSR too — no new secret. Ordered around one asymmetry: npm allows an unpublish within 72 hours, JSR versions are immutable and can never be replaced. So JSR goes last, where a failure costs a re-run rather than a version number, and a dry run gates both before either ships — JSR checks slow types and module structure that npm never looks at, and finding that out mid-release leaves the tag half-shipped. Signed-off-by: Diego Resendez --- .github/workflows/release.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 733e6e4..5f72ed3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,8 +33,23 @@ jobs: # No NODE_AUTH_TOKEN — npm exchanges the OIDC id-token for a short-lived publish token. # A prerelease (26.7.0-beta.N) publishes under its channel tag (beta/alpha/rc) so `latest` # never points at a beta; a stable version publishes under `latest`. - - name: Publish + - uses: denoland/setup-deno@v2 + with: + deno-version: v2.x + # Gate both registries before either one ships. JSR checks things npm never looks at — slow + # types, module analysis — and learning about them after npm has published leaves the tag + # half-shipped. Seconds, against a failure mode with no clean recovery. + - run: deno publish --dry-run + - name: Publish to npmjs run: | TAG=$(node -e "const v=require('./package.json').version;const m=v.match(/-([a-z]+)/);console.log(m?m[1]:'latest')") echo "dist-tag: $TAG" npm publish --access public --tag "$TAG" + # JSR last, deliberately. npm allows an unpublish within 72 hours; JSR versions are immutable + # and can never be replaced or removed. Ordered so a failure here costs a re-run, while a + # failure *after* it would cost a version number permanently. Version and entry points come + # from deno.json, which `test/package-metadata.test.ts` pins to package.json — JSR has no + # dist-tags, so a prerelease simply publishes under its own version. Auth is the same OIDC + # id-token npm just used; the package is linked to this repository on jsr.io. + - name: Publish to JSR + run: deno publish