Skip to content

Commit

Permalink
ci(publish): add publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
unadlib committed Nov 7, 2020
1 parent 776719d commit 97da167
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Node.js Package

on:
release:
types: [created]

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: yarn
- run: yarn build
- run: yarn test
- run: npm run publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
CI: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Travis](https://img.shields.io/travis/unadlib/usm.svg)](https://travis-ci.org/unadlib/usm)
[![npm](https://img.shields.io/npm/v/usm.svg)](https://www.npmjs.com/package/usm)

USM is a universal state modular library, supports Redux(v4.x), MobX(v6.x), Vuex(v4.x) and Angular(v2.0+).
USM is a universal state modular library, supports Redux(4.x), MobX(6.x), Vuex(4.x) and Angular(2.0+).

## Support

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"test": "yarn test:dev",
"check:type": "tsc --noEmit",
"build": "cross-env NODE_ENV=production ts-node scripts/build.ts",
"clean": "lerna exec rimraf ./dist ./build"
"clean": "lerna exec rimraf ./dist ./build",
"update:version": "lerna version --amend --no-git-tag-version",
"publish": "lerna exec --no-private --no-bail -- npm publish"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 97da167

Please sign in to comment.