-
Notifications
You must be signed in to change notification settings - Fork 827
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
Setting up a changesets based release workflow #681
Conversation
Create changeset workflow
Release Tracking
Conflicts: package.json
I believe this pull request is ready. But with most actions based things, we won't really be sure it's working until we run through the workflow once |
@@ -1,21 +1,28 @@ | |||
{ | |||
"private": true, |
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.
I'd rather keep this private, but changesets will skip if they find private true here, so I'm trying to avoid publishing main package.json file by adding
+ "publishConfig": {
+ "registry": "http://localhost:4873"
+ },
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.
Where does that port number come from?
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.
I was wanting to point to anything other than npm and co-pilot suggested this 😆 The point is to fail it out so people don't npm publish
from their terminal.
I'll accept whatever you think 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.
hmm, should we just say like "no registry"
or something to make it clear that this is a noop?
Using http://localhost:4873
feels like it's pointing to something real
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.
"publishConfig": {
"registry": "no registry, don't publish from this package.json."
},
.github/workflows/build.yml
Outdated
branches-ignore: | ||
- 'dependabot/**' | ||
release: | ||
types: [published] | ||
name: Octicons Build |
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.
Should we rename this workflow to "publish"?
|
||
Once maintainers have agreed and are satisifed with the release. Merge the Release pull request. Changesets will then publish a new GitHub release to the repository with the changelog and new version number. A second action will be triggered by this release and publish the new versions to npm and rubygems. |
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.
Should we add a link to this document in here somewhere?
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.
Nice I didn't realize we had these docs 👍🏻
gem "rake" | ||
gem "rubocop", "0.59" | ||
gem "rubocop-github", "0.12.0" | ||
end |
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.
Not too familiar with how Gemfiles work. What does this do?
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.
It's a bit like package.json, I needed to pull these dev dependencies up to the root so I could run bundle rake
in each of the folders.
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 genius 🤯 Excellent work, @jonrohan! This will save us so much time.
🦋 Changeset detectedLatest commit: c394d9a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This PR creates a Changesets based release workflow for octicons. We're already using this workflow in primer/css, primer/primitives, primer/react, ... but we weren't using here because of the mixed language nature of primer/octicons it made this difficult.
Strategy
Changesets is built around npm, and if this repo was only that it wouldn't be a problem. What we had to overcome was publishing 3 npm packages and 3 rubygems packages when releases were created.
I had a breakthrough recently when I realized all I need changesets to do is manage the changelog and create the GitHub release. From that GitHub release we can trigger the normal build action that we're running today.
This allows us to use changesets here. To get this workflow right I did testing in this private fork octicons-test repo. I was able to get changesets to create the release PR https://github.com/primer/octicons-test/pull/2 versioning all the packages then when that was merged it created the GitHub release https://github.com/primer/octicons-test/releases/tag/v16.0.1. The trick here was making changesets think we published to npm https://github.com/primer/octicons/blob/setup_changesets_workflow/.github/workflows/release.yml#L43