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

feat: use release-it for quick deployments #135

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

johnrees
Copy link
Contributor

this might be a quicker way to publish to npm and create the github release?

when you are ready to publish a new build just go to the main branch locally, make sure everything has been committed and there are no changes left to publish then run pnpm release

it will prompt you but you can press ENTER for pretty much everything, the only thing you'd need to read is when it asks if you're publishing a breaking change i.e. picking the version number

dry run example https://asciinema.org/a/q6WJ5ISD9kej0YbA7BXIiPd0Q?speed=3

related #30

@netlify
Copy link

netlify bot commented Mar 28, 2022

Deploy Preview for oslmap ready!

Name Link
🔨 Latest commit 5f7cd0b
🔍 Latest deploy log https://app.netlify.com/sites/oslmap/deploys/6242ec9ee0526f00088ce3d2
😎 Deploy Preview https://deploy-preview-135--oslmap.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

"after:git:release": [],
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
}
}
Copy link
Member

Choose a reason for hiding this comment

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

this seems smart, I like it! i noticed changelog notes in the screencast too, but don't see any reference to those here - am i understanding it right that the changelog is auto-generated based on any commits to main since last publish - will it just tack those onto our existing CHANGELOG.md?

was originally thinking a publish/release action would be kicked off by any PR merge where we edit package.json version & changelog, but if changelog notes are auto generated here and you can pick the version number during the run, then this fully negates the step of opening that PR altogether, am I understanding that right?

Copy link
Member

Choose a reason for hiding this comment

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

also, can someone with write access to the repo, but not npm org/package, run pnpm release successfully from main? not sure i understand how npm permissions are being handled here - an env secret in repo settings??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah yeah so once this is running from GH actions we could create an auth token in NPM that we can store in github secrets, but right now only people in the opensystemslab org on npm would be authorised to push a new release from their local machines

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • for now you won't need to open a PR for new releases, just run pnpm release from main when it's ready to go and it will auto-bump the package.json version number and move what's in unreleased in the changelog into a new release section. Added some details in a new comment below :)

Copy link
Member

Choose a reason for hiding this comment

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

brilliant, thanks for explaining!

@johnrees
Copy link
Contributor Author

johnrees commented Mar 29, 2022

release-it.mov

in the video I say no to the npm/github push etc, normally you'd just hit enter (Y) for all of these


OK so if we keep an ### [Unreleased] section at the top of the changelog, when a release is created it will move all of what's in that section into a new release section automatically. This way we can merge things into main as we have been doing then someone can locally run pnpm release and it will create a new release from main, commit it with a tag, push it to npm and create a release on github.

So flow would be:

  • create a PR, if it's a significant change add the PR info into the Unreleased bit of the CHANGELOG although this could definitely be automated as people are likely to forget_
  • approve and squash PR into main
  • whenever someone is ready to make a new release, checkout main locally, run pnpm release

we could probably run all this from github actions and automate the pull request changes in the doc too but maybe we take it one step at a time?

Copy link
Member

@jessicamcinchak jessicamcinchak left a comment

Choose a reason for hiding this comment

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

happy for this to merge whenever & try it out for our next release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants