-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add release task #18
Add release task #18
Conversation
faf45e3
to
222231e
Compare
8f63848
to
d9d5a42
Compare
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 a great improvement! I think gem-release
can further simplify for us?
CI is still using Ruby 2.7 as of the time of this committing, and github_changelog_generator is dependant on a version of the io-event gem that isn't available for Ruby <3.0. If and when CI updates it's Ruby we can remove this restriction.
@@ -34,6 +36,8 @@ jobs: | |||
strategy: | |||
matrix: | |||
ruby-version: ['2.7'] | |||
env: | |||
BUNDLE_WITHOUT: 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.
👌
current_branch = `git branch --show-current`.chomp | ||
raise 'could not get current branch' if current_branch.empty? | ||
|
||
sh 'git', 'checkout', '-b', 'new-release' if current_branch == 'main' |
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.
Will this fail the second time unless we delete the branch locally? Maybe we should name the branch after the 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.
Ya, so that's tricky because we don't know the version until the next command ... we could use gem bump --pretend
and parse the output, I considered that, but went with simple.
wrt failing the second time, the default when we merge a PR is to delete the branch, so I assumed this would actually not be an issue in practice. Of course, that risks completely backfiring ... wdyt? Worth the extra complexity of trying to extract the new version number?
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.
Oh, the other option, of course, is bump as we do, without committing, and then creating the branch after. I was worried that creating the branch might fail, for reasons unknown, and we'd be straight back to messy-land.
Some minor automation around the release process, this would allow us to have the version bump and changelog updated in a single commit, and with more automation.
Should we automate further, and include the
git commit
andgit tag
as part of the Rake task? Leaving thegit push
for the user to do once they've examined the change.Is the
v
inv1.0.0
important? This change does away with it.