Files
starter-workflows/ci/npm-publish.yml
T
Edward Thomson 391c5961e9 npm-publish: remove explicit scope
The setup-node action will default the scope to the correct user (the repo owner), so we do not need to explicitly include it in the workflow.  Removing it ensures that the starter template is easier for people to use; now there are no changes necessary to get started.  https://github.com/actions/setup-node/blob/master/src/authutil.ts#L26
2020-03-20 12:17:18 +00:00

48 lines
1.2 KiB
YAML

# 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
name: Node.js Package
on:
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
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 publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
publish-gpr:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://npm.pkg.github.com/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}