File tree Expand file tree Collapse file tree 1 file changed +59
-0
lines changed
Expand file tree Collapse file tree 1 file changed +59
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Continuous Integration
2+
3+ on :
4+ push :
5+ branches : [ master ]
6+ pull_request :
7+ branches : [ master ]
8+ release :
9+ types : [ created ]
10+
11+ # See https://docs.npmjs.com/trusted-publishers#step-2-configure-your-cicd-workflow
12+ permissions :
13+ id-token : write
14+ contents : read
15+
16+ jobs :
17+ build :
18+
19+ runs-on : ubuntu-latest
20+
21+ steps :
22+ - name : Checkout code
23+ uses : actions/checkout@v4
24+
25+ - name : Setup Node
26+ uses : actions/setup-node@v4
27+ with :
28+ node-version : 20
29+
30+ - name : Install dependencies
31+ run : npm install
32+
33+ publish :
34+ needs : build
35+ runs-on : ubuntu-latest
36+ if : ${{ github.event_name == 'release' }}
37+
38+ steps :
39+ - name : Checkout code
40+ uses : actions/checkout@v4
41+
42+ - name : Setup Node
43+ uses : actions/setup-node@v4
44+ with :
45+ node-version : 20
46+ registry-url : https://registry.npmjs.org/
47+
48+ # Ensure npm 11.5.1 or later is installed
49+ - name : Update npm
50+ run : npm install -g npm@latest
51+
52+ - name : Install dependencies
53+ run : npm install
54+
55+ - name : Set new version
56+ run : npm version --allow-same-version --no-git-tag-version ${{ github.event.release.tag_name }}
57+
58+ - name : Publish release
59+ run : npm publish
You can’t perform that action at this time.
0 commit comments