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 NPM
2+ on :
3+ push :
4+ branches :
5+ - main
6+ tags : v*
7+ workflow_dispatch :
8+ inputs :
9+ version :
10+ description : ' Optional version to publish (major.minor.patch). If not provided, the current version specified in package.json will be published.'
11+ required : false
12+
13+ jobs :
14+ build :
15+ runs-on : ubuntu-latest
16+
17+ permissions :
18+ contents : read
19+ id-token : write
20+
21+ steps :
22+ - uses : actions/checkout@v6
23+ - uses : actions/setup-node@v6
24+ with :
25+ node-version : " 24"
26+ registry-url : " https://registry.npmjs.org"
27+ - run : npm install
28+ - run : npm test
29+ - name : Set package version (optional)
30+ if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version != '' }}
31+ run : npm version "${{ github.event.inputs.version }}" --no-git-tag-version
32+ - run : npm publish --ignore-scripts --provenance --access public
You can’t perform that action at this time.
0 commit comments