From 8f25b63718ada78acc39b594acace100f9a9de68 Mon Sep 17 00:00:00 2001 From: yetone Date: Sat, 3 Oct 2026 00:00:23 +0800 Subject: [PATCH] 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. --- .github/workflows/publish.yml | 33 +++++++++++++++++++++++++++++++ packages/cline/package.json | 3 ++- packages/commandcode/package.json | 3 ++- packages/cursor/package.json | 3 ++- packages/devin/package.json | 3 ++- packages/factory/package.json | 3 ++- packages/kiro/package.json | 3 ++- packages/mimo/package.json | 3 ++- packages/minimax/package.json | 3 ++- packages/qoder/package.json | 3 ++- packages/workbuddy/package.json | 3 ++- packages/zed/package.json | 3 ++- scripts/publish.sh | 4 +++- 13 files changed, 58 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..a683f94 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +# Publishes every package whose version isn't on npm yet, from GitHub +# Actions with npm's trusted publishing (OIDC): no token and no one-time +# password. Each package names this workflow as its trusted publisher on +# npmjs.com (package → Settings → Trusted Publisher). +name: publish + +on: + push: + branches: [main] + paths: ["packages/*/package.json"] + workflow_dispatch: + +permissions: + id-token: write # npm's OIDC exchange + contents: read + +concurrency: publish + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + - uses: actions/setup-node@v4 + with: + node-version: 24 # npm 11.5+, which speaks trusted publishing + registry-url: https://registry.npmjs.org + - name: test + # the tests refuse a real home: no real sign-in is ever read + run: HOME=$(mktemp -d) bun test + - name: publish + run: scripts/publish.sh diff --git a/packages/cline/package.json b/packages/cline/package.json index 64bc198..c061c13 100644 --- a/packages/cline/package.json +++ b/packages/cline/package.json @@ -7,5 +7,6 @@ "exports": "./index.mjs", "files": ["index.mjs", "README.md"], "keywords": ["opencode", "opencode-plugin", "magpie", "cline", "clinepass"], - "license": "MIT" + "license": "MIT", + "repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/cline" } } diff --git a/packages/commandcode/package.json b/packages/commandcode/package.json index a401494..30c66cc 100644 --- a/packages/commandcode/package.json +++ b/packages/commandcode/package.json @@ -7,5 +7,6 @@ "exports": "./index.mjs", "files": ["index.mjs", "README.md"], "keywords": ["opencode", "opencode-plugin", "magpie", "commandcode"], - "license": "MIT" + "license": "MIT", + "repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/commandcode" } } diff --git a/packages/cursor/package.json b/packages/cursor/package.json index d457d57..a2c1816 100644 --- a/packages/cursor/package.json +++ b/packages/cursor/package.json @@ -7,5 +7,6 @@ "exports": "./index.mjs", "files": ["index.mjs", "README.md"], "keywords": ["opencode", "opencode-plugin", "magpie", "cursor"], - "license": "MIT" + "license": "MIT", + "repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/cursor" } } diff --git a/packages/devin/package.json b/packages/devin/package.json index 951897f..ab08fa1 100644 --- a/packages/devin/package.json +++ b/packages/devin/package.json @@ -7,5 +7,6 @@ "exports": "./index.mjs", "files": ["index.mjs", "README.md"], "keywords": ["opencode", "opencode-plugin", "magpie", "devin", "windsurf"], - "license": "MIT" + "license": "MIT", + "repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/devin" } } diff --git a/packages/factory/package.json b/packages/factory/package.json index bb1fcd3..5a5f33d 100644 --- a/packages/factory/package.json +++ b/packages/factory/package.json @@ -6,5 +6,6 @@ "main": "./index.mjs", "files": ["index.mjs", "README.md"], "keywords": ["opencode", "opencode-plugin", "magpie", "factory", "droid"], - "license": "MIT" + "license": "MIT", + "repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/factory" } } diff --git a/packages/kiro/package.json b/packages/kiro/package.json index 863bb73..39eeb5f 100644 --- a/packages/kiro/package.json +++ b/packages/kiro/package.json @@ -7,5 +7,6 @@ "exports": "./index.mjs", "files": ["index.mjs", "README.md"], "keywords": ["opencode", "opencode-plugin", "magpie", "kiro"], - "license": "MIT" + "license": "MIT", + "repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/kiro" } } diff --git a/packages/mimo/package.json b/packages/mimo/package.json index 141c873..2b414e9 100644 --- a/packages/mimo/package.json +++ b/packages/mimo/package.json @@ -7,5 +7,6 @@ "exports": "./index.mjs", "files": ["index.mjs", "README.md"], "keywords": ["opencode", "opencode-plugin", "xiaomi", "mimo"], - "license": "MIT" + "license": "MIT", + "repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/mimo" } } diff --git a/packages/minimax/package.json b/packages/minimax/package.json index fbf88f6..1086fed 100644 --- a/packages/minimax/package.json +++ b/packages/minimax/package.json @@ -7,5 +7,6 @@ "exports": "./index.mjs", "files": ["index.mjs", "README.md"], "keywords": ["opencode", "opencode-plugin", "minimax", "mcode", "minimax-code"], - "license": "MIT" + "license": "MIT", + "repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/minimax" } } diff --git a/packages/qoder/package.json b/packages/qoder/package.json index 7fb3b59..60a63ee 100644 --- a/packages/qoder/package.json +++ b/packages/qoder/package.json @@ -7,5 +7,6 @@ "exports": "./index.mjs", "files": ["index.mjs", "README.md", "LICENSE-CLIProxyAPI"], "keywords": ["opencode", "opencode-plugin", "magpie", "qoder", "qoder-cn"], - "license": "MIT" + "license": "MIT", + "repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/qoder" } } diff --git a/packages/workbuddy/package.json b/packages/workbuddy/package.json index 42d9b37..29899d4 100644 --- a/packages/workbuddy/package.json +++ b/packages/workbuddy/package.json @@ -7,5 +7,6 @@ "exports": "./index.mjs", "files": ["index.mjs", "README.md"], "keywords": ["opencode", "opencode-plugin", "workbuddy", "codebuddy"], - "license": "MIT" + "license": "MIT", + "repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/workbuddy" } } diff --git a/packages/zed/package.json b/packages/zed/package.json index 13161e3..d9c8ddd 100644 --- a/packages/zed/package.json +++ b/packages/zed/package.json @@ -6,5 +6,6 @@ "main": "./index.mjs", "files": ["index.mjs", "README.md"], "keywords": ["opencode", "opencode-plugin", "magpie", "zed"], - "license": "MIT" + "license": "MIT", + "repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/zed" } } diff --git a/scripts/publish.sh b/scripts/publish.sh index e20b87c..9aa1d4d 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -1,6 +1,8 @@ #!/bin/sh # Publishes every package whose version isn't on npm yet. -# scripts/publish.sh (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")/.."