File tree Expand file tree Collapse file tree 4 files changed +32
-1
lines changed
Expand file tree Collapse file tree 4 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 2626 git diff
2727 exit 1
2828 fi
29+ - run : |
30+ npm run version
31+ if [ "$(git diff | wc -l)" -gt "0" ]; then
32+ echo "Check version fail, please run 'npm run version' to fix."
33+ git diff
34+ exit 1
35+ fi
Original file line number Diff line number Diff line change 1+ name : Publish
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ jobs :
8+ publish-npm :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v3
12+ - uses : actions/setup-node@v3
13+ with :
14+ node-version : ' 16.x'
15+ registry-url : ' https://registry.npmjs.org'
16+ - run : npm ci
17+ - run : npm publish --access public
18+ env :
19+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 1+ # How to release
2+
3+ 1 . Update the version in ` package.json ` and run ` npm run version ` . Then merge the PR.
4+ 2 . Publish a new GitHub release.
5+ 3 . The npm pacakge will be published automatically.
Original file line number Diff line number Diff line change 1919 "pretest" : " npm run build" ,
2020 "test" : " jest __tests__ --passWithNoTests" ,
2121 "integrationTest" : " npm run build && jest integration-test --passWithNoTests" ,
22- "version" : " echo \" export const Version = '$npm_package_version'\" > src/version.ts && git add src/version.ts && npm run build " ,
22+ "version" : " echo \" export const Version = '$npm_package_version'\" > src/version.ts" ,
2323 "prepublishOnly" : " npm run build"
2424 },
2525 "prettier" : {
You can’t perform that action at this time.
0 commit comments