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

Add release task #18

Merged
merged 7 commits into from
Jun 22, 2022
Merged

Add release task #18

merged 7 commits into from
Jun 22, 2022

Conversation

misaka
Copy link
Contributor

@misaka misaka commented Jun 21, 2022

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 and git tag as part of the Rake task? Leaving the git push for the user to do once they've examined the change.

  • Is the v in v1.0.0 important? This change does away with it.

@misaka misaka force-pushed the add-release branch 2 times, most recently from faf45e3 to 222231e Compare June 21, 2022 15:41
@misaka misaka force-pushed the add-release branch 5 times, most recently from 8f63848 to d9d5a42 Compare June 21, 2022 16:12
Copy link
Contributor

@duncanjbrown duncanjbrown left a 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?

Rakefile Outdated Show resolved Hide resolved
Rakefile Outdated Show resolved Hide resolved
Rakefile Outdated Show resolved Hide resolved
misaka added 6 commits June 22, 2022 13:20
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
Copy link
Contributor

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'
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

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.

@misaka misaka merged commit 7134196 into main Jun 22, 2022
@misaka misaka deleted the add-release branch June 22, 2022 14:57
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