diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml new file mode 100644 index 0000000..78e0a51 --- /dev/null +++ b/.github/workflows/publish-npm.yml @@ -0,0 +1,32 @@ +name: Publish + +on: + workflow_dispatch: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - run: npm ci + - run: npm test + - run: npm run build --if-present + publish-npm: + needs: build + 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: npm ci + - run: npm run build --if-present + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}}