Skip to content

Commit

Permalink
ci: update action with npm publish action and newer setup actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jwu910 committed Jul 13, 2023
1 parent b9d80d5 commit 66e5524
Showing 1 changed file with 12 additions and 24 deletions.
36 changes: 12 additions & 24 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node.js Package
name: Publish to NPM

on:
release:
Expand All @@ -8,38 +8,26 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: "16"
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
node-version: "16"
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@v1
- uses: actions/setup-node@v1
- uses: JS-DevTools/npm-publish@v2
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
scope: '@jwu910'
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.ACTION_PUBLISH_TOKEN}}
token: ${{ secrets.NPM_TOKEN }}

- if: ${{ steps.publish.outputs.type }}
run: echo "Package upgraded from ${{ steps.publish.outputs.old-version }} to ${{ steps.publish.outputs.version }}!"

0 comments on commit 66e5524

Please sign in to comment.