Commit Graph
7 Commits
Author SHA1 Message Date
yetone f5308cdb0f publish: every version is packed onto the dist branch, so a new plugin merges without waiting for npm
A new package's first npm version can't go through trusted publishing
(a Trusted Publisher is set on a package that exists, with an owner's
2FA), so reviewed plugin PRs (#84 and others) sat unmerged until an owner
published by hand. Now publish.yml's dist job packs every package's
version (scripts/dist.mjs, npm pack --ignore-scripts) onto the dist
branch: tgz/<file> and index.json with each tarball's sha512. magpie
installs a @magpie-community package from there when npm doesn't have
the version. A new package without NPM_TOKEN is a notice, not a failed
run; a version npm refuses still fails it, now naming the stage-only
default of trusts made since 2026-09-03 and --allow-publish.

Run: node scripts/dist.mjs into an empty folder packed all 22 packages
(index.json 164K); the zed tarball's sha512 equals npm pack's integrity;
a second run packs nothing. The workflow itself is tried on main after
this push (workflow_dispatch).
2026-10-15 04:42:51 +08:00
yetone 4ef68fbf3f publish: an NPM_TOKEN secret publishes what trusted publishing can't, a new package's first version and one with no Trusted Publisher, so nobody publishes by hand
Every publish run on main since 13:27 UTC 10-14 is red: opencode-zed-auth
0.1.7 and opencode-zen-free-auth 0.1.6 answer 404 because their Trusted
Publisher isn't set, and a new package (opendesign-auth, AstraFlow) can't be
created by OIDC at all. Each of those needed an org owner's OTP by hand.

npm tries OIDC first and falls back to the token in .npmrc, so publish.yml
now hands setup-node's NODE_AUTH_TOKEN the repository's NPM_TOKEN secret.
publish.sh publishes a new package when the token is there instead of
passing it by, and its errors say which of the two is missing or that the
token expired. The PR check now notes a new package instead of failing,
since the merge publishes it. README gains a Publishing section with the
one-time token setup.

Run: sh -n on both scripts; scripts/new-to-npm.sh against npm (every
package is on npm); scripts/publish.sh with GITHUB_ACTIONS=true and a fake
npm on PATH (zed-auth "new"): token -> published with the token, exit 0; no
token -> ::error naming it, exit 1; token refused -> ::error saying replace
the token, exit 1.
Not tried: a real publish with a token, since the secret doesn't exist yet.
2026-10-15 01:58:21 +08:00
yetone 17f46b7a15 publish: a package npm refuses doesn't stop the ones after it — model-map 0.1.1 (no Trusted Publisher yet) answered 404 and trae 0.2.4, after it in the list, was never published 2026-10-06 02:27:34 +08:00
yetone cc20fcaba9 publish: a package npm has never seen no longer stops the rest — trusted publishing can't create a package, so trae-auth 0.1.0's PUT came back 404 (run 37104702928) and set -e would have left every package after it (workbuddy, zcode, zed) unpublished on their next bump. In Actions a new package is passed by with an error naming the way out (its first version by hand with scripts/publish.sh <otp>, then this workflow as its Trusted Publisher), the rest are published, and the run fails at the end naming it. Tried with a stubbed npm publish: zed bumped publishes after trae is passed by, exit 1. 2026-10-03 15:18:18 +08:00
yetone 8f25b63718 publish from GitHub Actions with npm's trusted publishing, no one-time password [skip ci]
.github/workflows/publish.yml runs the tests (in a throwaway HOME) and
scripts/publish.sh on each package.json change pushed to main, or by hand;
npm's OIDC exchange stands in for a token and an OTP. Every package now
names magpie-community/plugins' publish.yml as its trusted publisher on
npmjs.com, and gets the repository field npm checks it against.
2026-10-03 00:00:23 +08:00
yetone dbc1c301df publish: always to registry.npmjs.org, whatever ~/.npmrc names — with npmmirror as the registry (common in China) the publish went there and was refused (ENEEDAUTH), and npm view checked the mirror for what is published 2026-10-02 16:58:50 +08:00
yetone e2301c37ed scripts/publish.sh: publishes every package whose version isn't on npm yet, with one OTP for the lot 2026-09-30 21:23:08 +08:00