Files
starter-workflows/ci/npm-publish.yml
T

51 lines
1.2 KiB
YAML
Raw Normal View History

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
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
2019-12-24 14:22:22 -08:00
- uses: actions/checkout@v2
2021-04-09 22:34:42 +00:00
- uses: actions/setup-node@v2
with:
2021-06-25 21:00:29 +00:00
node-version: 14
- 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-04-09 22:34:42 +00:00
- uses: actions/setup-node@v2
with:
2021-06-25 21:00:29 +00:00
node-version: 14
registry-url: https://registry.npmjs.org/
2019-08-20 15:00:38 -07:00
- run: npm ci
- run: npm publish
env:
2020-11-30 17:02:58 +00:00
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
publish-gpr:
needs: build
runs-on: ubuntu-latest
2021-04-27 15:14:34 +00:00
permissions:
contents: read
packages: write
steps:
2019-12-24 14:22:22 -08:00
- uses: actions/checkout@v2
2021-04-09 22:34:42 +00:00
- uses: actions/setup-node@v2
with:
2021-06-25 21:00:29 +00:00
node-version: 14
2020-11-30 17:02:58 +00:00
registry-url: $registry-url(npm)
2019-08-20 15:00:38 -07:00
- run: npm ci
- run: npm publish
env:
2019-08-07 14:43:09 -07:00
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}