-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
automated npm publish throught github actions
- Loading branch information
1 parent
45d8daf
commit 8f428f0
Showing
2 changed files
with
12 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,20 @@ | ||
# 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://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | ||
|
||
name: Node.js Package | ||
|
||
name: "publish npm" | ||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- run: npm test | ||
|
||
publish-gpr: | ||
needs: build | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
- name: node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
registry-url: https://npm.pkg.github.com/ | ||
- run: npm publish | ||
node-version: 12 | ||
registry-url: https://registry.npmjs.org | ||
- name: publish | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.TOKEN_NPM}} | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters