-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[actions]: Add npm publish workflow #3460
Conversation
Signed-off-by: Varun Sharma <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #3460 +/- ##
=======================================
Coverage 97.57% 97.57%
=======================================
Files 129 129
Lines 9192 9192
Branches 3331 3331
=======================================
Hits 8969 8969
Misses 223 223 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Seems great! Just a few comments before we merge it and give it a shot.
Thanks @ljharb for the review! Updated the workflow. Here is the latest run: Example of when version did not match semver pattern using semver module: |
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.
Thanks, this seems pretty good :-)
aa94039
to
2d24640
Compare
Signed-off-by: Varun Sharma <[email protected]>
This PR adds a GitHub Actions workflow to publish to npm registry using one-time password (OTP).
step-security/wait-for-secrets
so OTP can be sent to the workflowIt requires setting two secrets:
NODE_AUTH_TOKEN
- this should be a Publish token for npm registry. The package should haverequire two-factor authentication to publish
checked in the package settings.SLACK_WEBHOOK_URL
- this is to get notification on Slack when OTP needs to be entered. If this notification is not needed, I can remove this part from the workflow.I have also added
harden-runner
to the publish job.Examples:
@ljharb, please let me know if you have any feedback.
Signed-off-by: Varun Sharma [email protected]