# Publishes every package whose version isn't on npm yet, from GitHub # Actions. npm tries trusted publishing (OIDC) first: a package that names # this workflow as its Trusted Publisher on npmjs.com needs nothing else. # What OIDC can't do, the NPM_TOKEN secret does: a package's first version # (trusted publishing can't create one) and a package whose Trusted # Publisher isn't set. NPM_TOKEN is an npm granular access token of a # magpie-community owner: read and write to the @magpie-community scope, # 2FA bypassed. With it nobody publishes by hand. 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 env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }}