- Notifications
You must be signed in to change notification settings - Fork 245
Bump patch version on each commit #433
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
| We also have the version on our Gradle scripts ( Also, I see that the |
.github/workflows/deploy.yml Outdated
| tags: | ||
| - '*' | ||
| branches: | ||
| - '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.
Hm, I think keeping the tag trigger would still be useful for manual releases (major versions et al) and would prefer not to trigger directly from branch pushes.
Since (IIRC) git pushes from GitHub Actions don't trigger a workflow, we could consider using a workflow_run trigger instead and move the bump logic into a separate workflow/YAML. That would also have the advantage of separating concerns more cleanly (version update vs. 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.
Ok, that sounds good! I've extracted the tags steps into another workflow that depends on the Build workflow having successfully completed. I've also changed the Deploy workflow to depend on the Tags workflow in the same way. My thinking is that the Build workflow runs on the commit to main, then once successful, the Tag workflow runs, then the Deploy.
Though I'm not sure if that solves being able to manually trigger a release. If we want to bump the major or minor version manually, do we intend to roll it into a change by pushing a new tag at the same time? Such as 1.4.0 or 2.0.0. Or would some sort of GitHub action be better for that?
Yes, we would effectively be adding an automated commit on top of every PR, which would add quite a bit of noise to the commit history too. If there's a way to avoid hardcoding the version at all into the Gradle project files, we might want to look into that (other languages like Swift rely entirely on git tags). I'm not sure whether it's idiomatic to omit the version from these files though. |
e3a26db to adab337 Compare | (Addressing both)
and
I've added the changes to pull the last git tag and apply that to the version of all projects. I've tested that by printing out the versions in each subproject to the console:
I think that you're right about the I need to re-test and will update this PR with the test results once I do it on another branch from my own fork. |
| I've tested it on another branch, autobump-test. To test, I've set the default branch to be the test branch, so that the Here are the successful runs. Note that whilst the Deploy workflow did fail overall, it's just to publish to @fwcd's repository. I probably should've commented those two steps out during testing. Created release: The changes after testing were:
|
| I've switched my default branch back to |
themkat left a comment
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.
Sorry for being a bit late with replying. Was away on a business trip for a while, and is still a bit jetlagged...
I'm all for having more automated releases, as having them manually like now leads to almost never releasing. Maybe we could add an automatic action to create a release-page as well? There are several of those (or we might just use gh in the pipeline for it). Might be a future PR, as it is super easy to just create a new release from tag.
Unsure on where to go from here. As @fwcd requested a change, I suggest we wait for possible comments from them.
| name: Tag | ||
| on: | ||
| workflow_run: | ||
| workflows: [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.
I may be stupid here, but should we have a specifier to make sure this only runs on the main branch? Build runs for PRs and stuff as well.
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.
Build runs for PRs and stuff as well.
That's true. During testing, it just runs for the default branch so that we can avoid that situation
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.
But will that not release for every PR in this repo? Out builds run for all PRs as well as 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.
I forgot to reply, apologies. I didn't think so but my knowledge of GitHub actions is limited. Perhaps to be safe, we adjust the settings to be something like "only run the release workflow when we merge a PR to he main branch". I'm not sure if that's possible. I'll have to look into it
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 should have been more clear, and not try to be educational 😛 (I usually do questions like the above instead of stating things directly. Probably a force of habit after being a teacher for a while). If we do not specify a branch, it will in theory run for all branches. Just like you have specified type and workflows above, you can also specify branches 🙂
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#limiting-your-workflow-to-run-based-on-branches
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.
@RenFraser , have you had any time to fix this comment? 🙂 Sorry for bothering you. Just hoping we can get something like this merged soon so we can avoid any more Kotlin 1.8.0 issues being reported.
| @fwcd , will you have time to look this over again after the changes you requested? Think it is best that you get to take a look before we look into merging this. (still one more comment from me that needs resolving before I'm comfortable doing so anyway). We need some sort of automatic releases, or at least releases more often. I understand you are busy a lot, and having them automatic would make life easy for us 🙂 Less issues that are easily fixed by newer versions containing fixes done in the last year. This PR can probably be a good step 1, where we can make eventual changes from there. |
| Hey, sorry for getting back on this so late. I understand that it's a bit frustrating, but I would really like to give it some more thought before we move forward with fully automated releases. The reason I am a bit hesitant with this is for a few reasons:
Also I think handling the implementation with all of the requirements (e.g. handling PR pushes correctly in every case, having the ability to release manually, maintaining a clean change log etc.) is not quite trivial, unfortunately. I've experimented a bit with this, one approach I've thought of was to consolidate the different workflows into a single file again with jobs and dependencies, something along the lines of: jobs: build: ... release: if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') && github.repository_owner == 'fwcd' needs: [build] ... # Create tag if this is not a tag push, then create a release (perform the latter in every case) ... deploy: needs: [deploy] ...This way the
I think that's a fair point and I will try to release more often. I'll put together a release this evening. |
That is super nice! I noticed that I suddenly had access rights to push tags, which failed before. Tried to make a release (by pushing a tag), but it failed. Seems like versions are included in the Again, sorry for nagging you about releases!! We are just super eager about this project! 🙂 EDIT: Found a workaround to get the filename to be |
| No need to do that, I wanted to update the release workflow anyway to use the |
| Thanks for getting back to me. I'll cancel this PR. If you're uncomfortable with continuous releases at this stage, perhaps making use of GitHub's pre-release mechanism would be useful instead?
I wonder if you would be interested in Conventional Commits? One of the major benefits is that it automatically generates a changelog for you. The Neovim repository has used it to good success for a long time now. |
Overview
mainbranch.It's my hope that by releasing features more quickly to users we can decrease duplicate issues, gather even more interest in the language server and encourage more contributions from users that wouldn't typically contribute.
Testing
autobump) to check whether the expected tags were pushed to the repository.Test Script