-
Notifications
You must be signed in to change notification settings - Fork 84
Create GitHub Action to publish new release #779
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
Conversation
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.
Looks great! I added a couple of comments. Also, I did a bit of research and found this:
https://github.com/semantic-release/semantic-release
They're doing some of the work we're doing here, and I'm wondering whether we could leverage some of it instead of reinventing the wheel (this would require changing some of our workflow, but this might be good)
(oh and one more thing, could you also update RELEASE.md)?
| release_type: | ||
| description: Type of release | ||
| required: true | ||
| default: patch |
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.
let's remove the default to prompt the user to give this more thought
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 tried that, but it just defaults to the first one (major) instead
| echo "Current version: $current_version" | ||
| - | ||
| name: Calculate new version | ||
| id: new_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.
At the end of this step, could the action show the version and ask the user to confirm it is correct?
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'll look into this
| .github/scripts/update_changelog.sh \ | ||
| "${{ needs.read-version.outputs.new_version }}" \ | ||
| "${{ needs.read-version.outputs.current_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.
Could we display the git diff here for the user to confirm before we commit?
| with: | ||
| ruby-version: "3.4" | ||
| bundler-cache: 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 think these probably need to be done before we create the tag. The tag is what triggers the upload to the rubygems (in our internal tooling), so these steps should probably happen before?
How to trigger a manual workflow: https://docs.github.com/en/actions/how-tos/manage-workflow-runs/manually-run-a-workflow
Closes #765
Creates a GitHub Actions workflow that builds and publishes a release when triggered manually.
The workflow:
lib/semian/version.rb,Gemfile.lock,CHANGELOG.mdand commits themCHANGELOG.mdcontains a list of commits with merge, dependabot, and version bumping filtered outHow to trigger a manual workflow
Testing:
workflow_dispatchworkflows must be triggered from themainbranch of a repository. Thus, for testing, it is necessary to test on a fork. An example (my fork) can be found at https://github.com/1spyral/semian/Reviewers: you can leave a comment on this PR if you wish to be added as a Contributor to my fork, where you can test the workflow with minimal setup of your own