File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish package on NPM
2+
3+ on :
4+ push :
5+ tags :
6+ - v* # Any version tag
7+
8+ permissions :
9+ id-token : write # To publish on NPM with provenance and to federate tokens
10+ contents : read # To read the package.json file
11+
12+ jobs :
13+ # Requires an approval
14+ npm-publish :
15+ runs-on : ubuntu-latest
16+ environment : npm
17+ steps :
18+ - uses : actions/checkout@v6
19+ - uses : actions/setup-node@v6
20+ with :
21+ node-version : 24
22+ registry-url : " https://registry.npmjs.org"
23+ - run : npm install
24+ - run : npm publish
25+ - uses : actions/github-script@v7
26+ with :
27+ script : |
28+ const tag = context.ref.replace('refs/tags/', '');
29+ await github.rest.repos.createRelease({
30+ owner: context.repo.owner,
31+ repo: context.repo.repo,
32+ tag_name: tag,
33+ name: tag,
34+ generate_release_notes: true,
35+ });
You can’t perform that action at this time.
0 commit comments