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.
This commit is contained in:
yetone
2026-10-03 00:00:23 +08:00
parent d7d8d61c42
commit 8f25b63718
13 changed files with 58 additions and 12 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
#!/bin/sh
# Publishes every package whose version isn't on npm yet.
# scripts/publish.sh <otp> (the one-time password of the npm account)
# scripts/publish.sh [otp] (by hand: the npm account's one-time password)
# GitHub Actions runs it with no password on each version bump pushed to
# main (.github/workflows/publish.yml, npm's trusted publishing).
# One password covers the lot: it is sent with each publish while it lasts.
set -e
cd "$(dirname "$0")/.."