Maintaining a version string in a project and using it for creating releases #26905
-
Hi I was looking into automating our release process with Actions and I am in a fix as to how I can best achieve a clean methodology. We want to make releases manually so something like Semantic Release is not going to be a good fit. As such I decided that we can create an action which creates a release and gets triggered when we want a release. The question was how to trigger this action. For that, I went with creating a
The 3rd solution seems to me to be the most flexible but it needs some effort in getting right. I was looking for opinions and insights as to which of these ideas is the best or if there is an even better idea. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
In fact, we have an official action provided by GitHub to create release (actions/create-release).
When creating a release, we need to provide a tag which generally is used as the version of the new release.
|
Beta Was this translation helpful? Give feedback.
-
Hi @brightran, thanks for the response. I didn’t mention it but I am already using the create-release action to create a release.
I meant that I created a workflow, not an action. Sorry for confusing the terms 🙏. But anyway, this is how my workflow looks right now
The My concern was that everytime I change this file, I also need to change the |
Beta Was this translation helpful? Give feedback.
-
You can try like as this:
In this way, you only need to changes the version number in the VERSION file to trigger the workflow, then the workflow will execute the ‘sed’ command to automatically changes the version in the ‘package.json’. |
Beta Was this translation helpful? Give feedback.
-
Nice, this is a great idea. Right now, I have implemented another idea which doesn’t require the workflow to make a commit but relies on the reviewer. I have added a workflow job which parses the
Hopefully this alternate idea can also help some people. |
Beta Was this translation helpful? Give feedback.
@sayakmukhopadhyay ,
You can try like as this:
In the workflow, use the ‘sed’ command to replace the variable name with the actual version number in the ‘package.json’.