Skip to content

Commit

Permalink
Publish to Github Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnault committed Jan 2, 2021
1 parent be4f5f7 commit 2de8db7
Showing 1 changed file with 38 additions and 4 deletions.
42 changes: 38 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow will run tests using node and then publish a package to npm when a release is created
# This workflow will run tests using node and then publish a package when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Publish Package
Expand All @@ -8,7 +8,23 @@ on:
types: [created]

jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- run: npm ci
- run: npm run build
- run: npm test
- uses: actions/upload-artifact@v2
with:
name: dist
path: dist

publish-npm:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -17,8 +33,26 @@ jobs:
node-version: 14
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm test
- run: npm run build
- uses: actions/download-artifact@v2
with:
name: dist
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

publish-gpr:
needs: build-and-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
registry-url: https://npm.pkg.github.com/
- run: npm ci
- uses: actions/download-artifact@v2
with:
name: dist
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit 2de8db7

Please sign in to comment.