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 to npm
1+ name : CI and Publish
2+
23on :
34 push :
5+ branches :
6+ - master
47 tags :
58 - ' *'
9+ pull_request :
10+ branches :
11+ - master
612
713permissions :
8- id-token : write # Required for OIDC (https://docs.npmjs.com/trusted-publishers)
14+ id-token : write # Required for OIDC (https://docs.npmjs.com/trusted-publishers)
915 contents : read
1016
1117jobs :
18+ test :
19+ runs-on : ubuntu-latest
20+
21+ steps :
22+ - name : Checkout code
23+ uses : actions/checkout@v4
24+
25+ - name : Set up Node.js
26+ uses : actions/setup-node@v4
27+ with :
28+ node-version : ' 24'
29+
30+ - name : Install dependencies
31+ run : npm ci
32+
33+ - name : Run tests
34+ run : npm run test
35+
1236 publish :
1337 runs-on : ubuntu-latest
38+ needs : test
39+ if : startsWith(github.ref, 'refs/tags/')
1440
1541 steps :
1642 - name : Checkout code
3056 run : |
3157 if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
3258 tags_name="${{ github.ref }}"
33- tags_name="${tags_name#refs/tags/}" # Remove the "refs/tags/" prefix
59+ tags_name="${tags_name#refs/tags/}"
3460 if [[ $tags_name == *"beta"* ]]; then
3561 echo "is_beta=true" >> $GITHUB_OUTPUT
3662 else
4167 - name : Publish to npm (beta)
4268 if : steps.is_tag_beta.outputs.is_beta == 'true'
4369 run : npm publish --tag beta
70+ env :
71+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
4472
4573 - name : Publish to npm
4674 if : steps.is_tag_beta.outputs.is_beta == 'false'
4775 run : npm publish
76+ env :
77+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments