11name : Publish to npm
22
3- # Manual, on-demand publish of the widget to npm.
3+ # Manual, on-demand publish of a package to npm.
44#
55# The release-please workflow already publishes automatically when it cuts a
66# release. This workflow exists for the cases that one can't handle:
7- # - bootstrapping the very first publish (the release for the current version
8- # already exists, so re-running release-please is a no-op), and
9- # - recovering from a failed release publish without waiting for the next
10- # release.
7+ # - bootstrapping the very first publish of a package (the release for the
8+ # current version already exists, so re-running release-please is a no-op), and
9+ # - recovering from a failed release publish without waiting for the next release.
1110#
1211# Requires the NPM_TOKEN secret to be an npm token that can publish the package
13- # and bypasses 2FA (a classic Automation token, or a granular token with
14- # "All packages" + read/write). Publishes with provenance (needs id-token).
12+ # (and create it on first publish) and bypasses 2FA — a granular token with
13+ # "All packages" + read/write, or an account-scoped token. Publishes with
14+ # provenance (needs id-token).
1515on :
1616 workflow_dispatch :
1717 inputs :
18+ package :
19+ description : " Which package to publish"
20+ type : choice
21+ options :
22+ - widget
23+ - create-claudius
24+ default : widget
1825 dist-tag :
1926 description : " npm dist-tag to publish under"
2027 required : false
@@ -25,16 +32,16 @@ permissions:
2532 id-token : write # for npm provenance
2633
2734concurrency :
28- group : publish-npm
35+ group : publish-npm-${{ github.event.inputs.package }}
2936 cancel-in-progress : false
3037
3138jobs :
3239 publish :
33- name : Publish widget to npm
40+ name : Publish ${{ inputs.package }} to npm
3441 runs-on : ubuntu-latest
3542 defaults :
3643 run :
37- working-directory : widget
44+ working-directory : ${{ inputs.package }}
3845 steps :
3946 - uses : actions/checkout@v4
4047
4754 node-version : 20
4855 registry-url : https://registry.npmjs.org
4956 cache : pnpm
50- cache-dependency-path : widget /pnpm-lock.yaml
57+ cache-dependency-path : ${{ inputs.package }} /pnpm-lock.yaml
5158
5259 - name : Install
5360 run : pnpm install --frozen-lockfile
0 commit comments