While there is no stable release, a bare `npm install @green-tea/core` should
get the same thing `@beta` gets — that is what the docs promise. Since
`1a313c2` a prerelease publishes under its channel tag only, so the next
release would have left `latest` behind on 26.8.0-beta.0: an older build for
anyone who installs without asking for a channel.
`npm publish` sets one tag, and `npm dist-tag` cannot use Trusted Publishing —
the OIDC exchange lives inside `publish.js` and nowhere else. Rather than keep
a long-lived npm token in a secret for one command, the step runs the same
exchange itself: request the Actions id-token, trade it for a short-lived
package-scoped token, move the tag. Both values are masked.
The rule is bounded on purpose. Once a stable version exists it owns `latest`
permanently, and a beta published afterwards must not drag it backwards; the
lookup that decides this is read into a variable first, so a failed request
fails the step instead of passing for "no stable exists".
Both publishes also become skip-if-present. That is not belt-and-braces: the
new step runs after them and can fail, so a re-run has to be able to finish
the remaining work instead of dying on a version npm would reject anyway. The
JSR guard asks api.jsr.io rather than jsr.io/meta.json, which is 404 for a
package with no versions yet — the state this package is actually in.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
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 <diego.resendez@zero-oneit.com>
AGENTS.md states the rule and ci.yml implements it: npm audit --omit=dev
blocks, everything else reports. stage.yml and release.yml ran a bare
npm audit, so a dev-only advisory could hold a publish.
That drift stopped work twice. The nanoid advisory reached the tree through
tsup -> postcss -> nanoid, a build-tooling path that ships to nobody, and
fixing it was a precondition for a release it could not affect.
The full audit still runs with continue-on-error, so nothing goes unseen.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
A beta/alpha/rc version must not become 'latest' on npmjs (else npm install serves a prerelease). Derive the dist-tag from the version: 26.7.0-beta.0 -> beta, stable -> latest.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
Replaces the NPM_AUTH secret on the prod path with npm Trusted Publishing: id-token: write + npm>=11.5.1, npm exchanges the OIDC token for a short-lived publish token and attaches provenance. Requires a trusted publisher configured on npmjs (Expressive-Tea/green-tea, release.yml).
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
One secret name across forges: Gitea's NPM_AUTH (org-level) = the Verdaccio token for staging; GitHub's NPM_AUTH = the npmjs token for production. Each forge supplies its own value.
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
stage.yml (Gitea-only): publish package to Verdaccio under 'stg' tag on main merge. promote.yml (Gitea-only): mirror only main + version tags to GitHub. release.yml (GitHub-only): publish stable to npmjs on a v* tag. Forge is detected via github.server_url; secrets: VERDACCIO_TOKEN (Gitea), GH_PROMOTE_TOKEN (Gitea, set), NPM_TOKEN (GitHub, pending).
Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>