File tree Expand file tree Collapse file tree 2 files changed +31
-14
lines changed
Expand file tree Collapse file tree 2 files changed +31
-14
lines changed Original file line number Diff line number Diff line change 1+ name : PR Build
2+ on : [pull_request]
3+ jobs :
4+ size :
5+ runs-on : ubuntu-latest
6+ env :
7+ CI_JOB_NUMBER : 1
8+ steps :
9+ - uses : actions/checkout@v3
10+ - name : setup node
11+ uses : actions/setup-node@v3
12+ with :
13+ node-version : 16
14+ - name : install dependencies
15+ run : |
16+ npm install
17+ CI=true npm run build
Original file line number Diff line number Diff line change 11name : Publish Package
22
33on :
4- push :
5- branches :
6- - main
4+ release :
5+ types : [published]
76
87jobs :
9- build :
8+ build :
109 runs-on : ubuntu-latest
1110 steps :
1211 - uses : actions/checkout@v3
1312 - uses : actions/setup-node@v3
1413 with :
1514 node-version : ' 16.x'
16- - run : npm ci
17- - run : npm run build
15+ registry-url : https://registry.npmjs.org/
1816
19- - name : Bump version & push
17+ - name : gitconfig
2018 run : |
2119 git config --global user.email "${{github.actor}}@users.noreply.github.com"
2220 git config --global user.name "${{github.actor}}"
2321
24- npm version patch
25-
26- git push -f && git push --tags -f
27- env :
28- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
29-
30- - run : npm publish
22+ - run : npm version${{ github.event.release.tag_name }}
23+ - run : npm install
24+ - name : Create .env with github secrets and run script
25+ run : |
26+ touch .env
27+ echo GITHUB_TOKEN=$GITHUB_TOKEN >> .env
28+ echo NODE_AUTH_TOKEN=$NODE_AUTH_TOKEN >> .env
29+ npm publish --access public
3130 env :
3231 NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
32+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments