Closed RenFraser closed 1 year ago
We also have the version on our Gradle scripts (server/build.gradle.kts
after #424, and gradle.properties
before that). I'm not a fan of automatic commits of file changes, so hopefully we can avoid that. Should we do anything to the build-script versions? Maybe just setting them to something to indicate a snapshot version or something similar?
Also, I see that the actions/create-release@v1
action runs still have ${{ github.ref }}
as it's inputs for version. Won't that mean that in this case it will be main
instead of a version? Because the PR changes the trigger from a tag to main-branch at the top of the workflow yaml. That is at least how I have always understood GITHUB_REF
. Should we maybe change these to ${{ steps.bump-semver.outputs.new_version }}
as well?
I'm not a fan of automatic commits of file changes
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.
(Addressing both)
If there's a way to avoid hardcoding the version at all into the Gradle project files, we might want to look into that
and
We also have the version on our Gradle scripts
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:
> Configure project :grammars
1.3.1
> Configure project :server
1.3.1
> Configure project :shared
1.3.1
> Task :prepareKotlinBuildScriptModel UP-TO-DATE
BUILD SUCCESSFUL in 2s
it will be main instead of a version?
I think that you're right about the github.ref
@themkat. I've pushed a change to address this too. :)
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 workflow_run
will be triggered. I've seen the Tag and Deploy workflows successfully trigger once the Build workflow had completed.
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:
Version <tag>
as the release name.deploy
to tag
.- uses: actions/checkout@v3
step to the tag workflow.server-<tag>.zip
instead of the expected server.zip
.if: github.repository == 'fwcd/kotlin-language-server'
condition from deploy workflow so that contributors can test their releases easier.I've switched my default branch back to main
to test that the Tag and Deploy workflows don't run on non-default branches. It looks like those steps haven't run for my latest commit test only build runs
: https://github.com/RenFraser/kotlin-language-server/actions
So where to from here? Do we still want to make any changes? :) @themkat @fwcd
@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:
CHANGELOG.md
. That makes it easy to get an overview over the changes to the language server without having to drill into the Git history (which is often too fine-grained to get a bigger picture). If we were to automate every release, the granularity of the releases would become diluted, we'd have to generate change log entries automatically, e.g. from merged PRs. But even PRs can vary wildly in scope (contrast a typofix with the implementation of semantic highlighting or the like).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 deploy
would get skipped whenever the release
job was skipped. But, as mentioned above, I'd like to hold off on progressing on this for now.
at least releases more often
I think that's a fair point and I will try to release more often. I'll put together a release this evening.
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 distZip
zip results... (e.g, server-1.3.2.zip
). Reverted my tag (deleted it).
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 server.zip
again. Setting the projectVersion
in server/build.gradle.kts
to the empty string. Not ideal, but might be a quick workaround to get a release out the door. ~Might need to do something similar for grammars.~
No need to do that, I wanted to update the release workflow anyway to use the gh
CLI instead of the deprecated action, so I'll just update the CI instead (including the version in the archive name seems useful to me).
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?
Manual releases let us split the releases into distinct sets of features that are documented in the CHANGELOG.md
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
main
branch.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