-
-
Notifications
You must be signed in to change notification settings - Fork 323
Create npm-publish.yml #636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,34 @@ | ||||||||||||
# 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 | ||||||||||||
|
||||||||||||
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 ci | ||||||||||||
- run: npm test | ||||||||||||
|
||||||||||||
publish-npm: | ||||||||||||
needs: build | ||||||||||||
runs-on: ubuntu-latest | ||||||||||||
steps: | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: Add permissions to the GH_TOKEN to be able to use npm provenance
Suggested change
|
||||||||||||
- uses: actions/checkout@v3 | ||||||||||||
- uses: actions/setup-node@v3 | ||||||||||||
with: | ||||||||||||
node-version: 16 | ||||||||||||
registry-url: https://registry.npmjs.org/ | ||||||||||||
- run: npm ci | ||||||||||||
- run: npm publish | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
env:single | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: extra "single" expression
Suggested change
|
||||||||||||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Use v4 for both actions (they were probably not released when the PR has been created 😄 )
This also applies to the other job in this workflow file.