[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. |
ljharb
left a comment
There was a problem hiding this comment.
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: |
ljharb
left a comment
There was a problem hiding this comment.
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-secretsso 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 publishchecked 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-runnerto the publish job.Examples:
@ljharb, please let me know if you have any feedback.
Signed-off-by: Varun Sharma [email protected]