-
Notifications
You must be signed in to change notification settings - Fork 1
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
chore: publish automatically to NPM #5
Conversation
dfee717
to
187e4b1
Compare
187e4b1
to
0d83dcb
Compare
Now that we're [automatically publishing some valora packages](valora-inc/logging#5), we don't want to wait for them to be pulled in by Renovate.
Now that's we're using [semantic-release](#5) it's important PR titles follow the convention. https://github.com/marketplace/actions/semantic-pull-request is a simple solution for this. We should probably add it to https://github.com/valora-inc/typescript-app-starter too.
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.
rad
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "@valora/logging", | |||
"version": "1.0.0", | |||
"version": "0.0.0-semantic-release", |
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.
good idea
.github/workflows/workflow.yaml
Outdated
uses: google-github-actions/get-secretmanager-secrets@v0 | ||
with: | ||
secrets: |- | ||
NPM_TOKEN:projects/1027349420744/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.
this is cool. does it need a version?
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.
The version is optional, I now realize there's an even shorter form:
# Long form
projects/<project-id>/secrets/<secret-id>/versions/<version-id>
# Long form - "latest" version
projects/<project-id>/secrets/<secret-id>
# Short form
<project-id>/<secret-id>/<version-id>
# Short form - "latest" version
<project-id>/<secret-id>
🎉 This PR is included in version 1.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Publish automatically to NPM so we can consume plugins from https://github.com/valora-inc/plugins-api Copied from valora-inc/logging#5
Publish automatically to NPM using [semantic-release](https://github.com/semantic-release/semantic-release) Similar to what we did in valora-inc/logging#5 Fixes RET-1037
This publishes the lib automatically when changes land on main.
It uses semantic-release for this.
A tag is created automatically and a GitHub release with a changelog.
See first successful publish: https://www.npmjs.com/package/@valora/logging
GitHub actions run: https://github.com/valora-inc/logging/actions/runs/3327458719/jobs/5502307846
And release: https://github.com/valora-inc/logging/releases/tag/v1.0.0
Note: I had temporary enabled publishing from this branch to ensure it's working end-to-end.
semantic-release can also update the package version and changelog committed in the repo, but it requires bypassing branch protection and giving more permission to the repo. I felt this wasn't really needed.