2020-02-20 12:44:22 -05:00
|
|
|
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
|
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
|
|
|
|
|
2019-08-07 19:46:00 -07:00
|
|
|
name: Node.js Package
|
2019-08-07 13:32:43 -07:00
|
|
|
|
|
|
|
|
on:
|
2019-09-17 12:31:43 -07:00
|
|
|
release:
|
|
|
|
|
types: [created]
|
2019-08-07 13:32:43 -07:00
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
build:
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
2019-12-24 14:22:22 -08:00
|
|
|
- uses: actions/checkout@v2
|
2021-03-13 14:34:06 +09:00
|
|
|
- uses: actions/setup-node@v2
|
2019-08-07 13:32:43 -07:00
|
|
|
with:
|
2021-06-21 13:29:17 -04:00
|
|
|
node-version: 14
|
2019-08-07 13:32:43 -07:00
|
|
|
- run: npm ci
|
|
|
|
|
- run: npm test
|
|
|
|
|
|
|
|
|
|
publish-npm:
|
|
|
|
|
needs: build
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
steps:
|
2019-12-24 14:22:22 -08:00
|
|
|
- uses: actions/checkout@v2
|
2021-03-13 14:34:06 +09:00
|
|
|
- uses: actions/setup-node@v2
|
2019-08-07 13:32:43 -07:00
|
|
|
with:
|
2021-06-21 13:29:17 -04:00
|
|
|
node-version: 14
|
2019-08-07 13:32:43 -07:00
|
|
|
registry-url: https://registry.npmjs.org/
|
2019-08-20 15:00:38 -07:00
|
|
|
- run: npm ci
|
2019-08-07 13:32:43 -07:00
|
|
|
- run: npm publish
|
|
|
|
|
env:
|
|
|
|
|
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
|
|
|
|
|
|
|
|
|
publish-gpr:
|
|
|
|
|
needs: build
|
|
|
|
|
runs-on: ubuntu-latest
|
2021-03-02 19:59:19 -06:00
|
|
|
permissions:
|
|
|
|
|
contents: read
|
|
|
|
|
packages: write
|
2019-08-07 13:32:43 -07:00
|
|
|
steps:
|
2019-12-24 14:22:22 -08:00
|
|
|
- uses: actions/checkout@v2
|
2021-03-13 14:34:06 +09:00
|
|
|
- uses: actions/setup-node@v2
|
2019-08-07 13:32:43 -07:00
|
|
|
with:
|
2021-06-21 13:29:17 -04:00
|
|
|
node-version: 14
|
2020-09-09 15:42:40 -07:00
|
|
|
registry-url: $registry-url(npm)
|
2019-08-20 15:00:38 -07:00
|
|
|
- run: npm ci
|
2019-08-07 13:32:43 -07:00
|
|
|
- run: npm publish
|
|
|
|
|
env:
|
2019-08-07 14:43:09 -07:00
|
|
|
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|