feat: #776 publish to npmjs upon manual github release (#1047)

This commit is contained in:
Bradley Zhou 2020-12-23 15:14:48 +08:00 committed by GitHub
parent c9c9e0d494
commit aaa8c813fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

33
.github/workflows/publish-npm.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: Publish to NPM registry
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
- name: Install dependencies
run: yarn bootstrap
- name: Lint
run: yarn lint
- name: Test
run: yarn test
publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
registry-url: https://registry.npmjs.org/
- run: yarn bootstrap
- run: yarn build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}