-
Notifications
You must be signed in to change notification settings - Fork 8
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
Auto change artifact version in action.yml #316
base: main
Are you sure you want to change the base?
Conversation
@gsmet Is there a way to create a QuickStart from the locally changed version of the extension? |
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 understand your pain and that's why I mostly use main
and 999-SNAPSHOT
and be done with it.
I know it's not ideal but IIUC I arrived at the conclusion that having versions wasn't so easy (see below).
While your approach is interesting as I didn't think of it at all, I think it has some flaws as you end up having to checkout a git repo, which is something that adds to the action initialization cost and then have a Maven execution (and potentially download missing artifacts) which adds even more.
I wonder if we should instead try to experiment with the Maven release plugin and see if we could adjust the file automatically during the release process.
Something with: https://stackoverflow.com/questions/37963689/maven-release-plugin-automatically-run-a-script-before-commit .
We could provide scripts if not entirely straightforward or even workflows (maybe one to create a branch - the Maven release plugin can also handle that and one to create a version from a branch with automated version increment (apparently --batch-mode
will do that)).
What bothers me a bit though is that we need to be completely sure that when you push to a new tag/branch, the jar has to be already available in the repository.
Meaning you cannot be in the following situation:
- the
action.yml
is in a branch and has been updated - the jar is not there so the action will fail
As for using the codestart of a deployed extension, if you add the extension with the full GAV (so with :999-SNAPSHOT
in it) when you create the project, it will use the updated codestart.
- name: Checkout repo | ||
uses: actions/checkout@v4 |
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 don't think this will work as you're going to be in the context of the repo in which you execute the action. It won't download the action code itself.
- name: Get project version | ||
shell: bash | ||
run: | | ||
echo "ACTION_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:3.5.0:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV |
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.
If we end up doing that, probably a good idea to rely on ./mvnw
as you're not guaranteed there is a Maven environment around (Maven will come with setup-java
but you could use this action in a workflow that doesn't use Java at all).
@gsmet Thank you for your thoughts. I completely understand, if you don't want to go down this route, this was simply the first solution that came to mind, mitigating the problem. Please understand it as food for thought for how to get a handle on the issue. You're probably right, not wanting to add to the initialisation cost generally, and keeping the QuickStart as simple as possible. For me it was just a bit surprising to deploy a new version of an action, and not having it stick. To prevent a similar experience for others, we could keep the QuickStart as is, but add a paragraph to the developer reference detailing versioning. Here we could offer a yet to be agreed upon example, on how to adjust the QuickStart to handle versioning. I'll definitely have a look at your idea with the release plugin. Regarding the versioning, I would proceed as follows:
As far as I understand it, we should be able to avoid the above mentioned problem
by first releasing the minor version, and updating the tag for the major version only, when the release of the new artifact is completed. This results in the following scenario:
This is how I understand it, but please keep in mind, I'm in no way an expert for GitHub generally, nor GitHub-Actions in particular. Any insights, on how to best get a grip on this problem are highly welcome. |
So there are some thoughts about how to handle things here: https://docs.quarkiverse.io/quarkus-github-action/dev/push-to-production.html but as you have experienced it, the situation is far from being ideal... I really think we should try the maven-release-plugin + workflow route. What is going to be a bit annoying are the branches as you basically have two sorts of branches:
What I'm wondering is if the following would work:
Because all in all, the If you're interested in pursuing this, I think it would have a lot of value. This thing has been bothering me for quite a while, I totally agree it's in the way of having an experience that is in line with what people expect from GitHub Actions. Not sure if my plan is clear? |
I see, where you're aiming at. I'll definitively look further into this. Please understand, I can't tell you exactly, when I can make time, to follow this through. I'll write any advances I make or questions I have here. |
Yeah sure, and don't feel obliged to anything. If you play with it and find interesting things about it, please post back and if you want to discuss this further, ping me, I'll be around. |
This PR version offers support for automatic release versioning via the maven The versioning scheme for the action should follow the smantic versioning specification (
You should create a new branch for each release, that isn't a patch release. Before creating a new release, the To release a new version create a new branch named
To release a patch for an existing version, simply add the changes to the respective When releasing a new version, a new incremental After the release workflow has finished you can fetch the new updates with The full version tags have the format The major version tag is changed after the artifact is deployed, therefore the client alwas references a valid version of the action. Some additional observations:
|
@gsmet If time permits, could you have a look, if that‘s the direction you‘d want to take this issue? |
Fixes #315
Maven Central
was changed to simplycentral