Skip to content
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

Merged
merged 13 commits into from
Oct 27, 2022

Conversation

jeanregisser
Copy link
Member

@jeanregisser jeanregisser commented Oct 26, 2022

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.

@jeanregisser jeanregisser force-pushed the jeanregisser/semantic-release branch 6 times, most recently from dfee717 to 187e4b1 Compare October 26, 2022 08:30
jeanregisser added a commit to valora-inc/renovate-config that referenced this pull request Oct 26, 2022
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.
jeanregisser added a commit that referenced this pull request Oct 26, 2022
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.
Copy link

@silasbw silasbw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rad

package.json Outdated Show resolved Hide resolved
@@ -1,6 +1,6 @@
{
"name": "@valora/logging",
"version": "1.0.0",
"version": "0.0.0-semantic-release",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea

uses: google-github-actions/get-secretmanager-secrets@v0
with:
secrets: |-
NPM_TOKEN:projects/1027349420744/secrets/NPM_TOKEN

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?

Copy link
Member Author

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>

@jeanregisser jeanregisser enabled auto-merge (squash) October 27, 2022 08:04
@jeanregisser jeanregisser merged commit 64a4c79 into main Oct 27, 2022
@jeanregisser jeanregisser deleted the jeanregisser/semantic-release branch October 27, 2022 08:05
@github-actions
Copy link

🎉 This PR is included in version 1.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

jeanregisser added a commit to valora-inc/hooks that referenced this pull request Mar 30, 2023
Publish automatically to NPM so we can consume plugins from
https://github.com/valora-inc/plugins-api

Copied from valora-inc/logging#5
jeanregisser added a commit to valora-inc/viem-account-hsm-gcp that referenced this pull request Apr 19, 2024
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 pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants