add publish workflow

This commit is contained in:
Dexter 2021-12-13 10:27:13 +00:00
parent 391bc6d490
commit cda3d325bb

38
.github/workflows/publish.yml vendored Normal file
View File

@ -0,0 +1,38 @@
---
name: Publish
"on":
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x]
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- name: Install
run: |
npm ci
# - name: Lint
# run: |
# npm run lint
- name: Test
run: |
npm test
- name: Push release to npm (public)
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
npm publish --access public .