Version bump happens after tagging
terlar opened this issue · 3 comments
Describe the bug
When building from source and using the tags the version will be wrong (the previous one). Since the commit bumping the version in the package.json
happens after the tagging.
To Reproduce
Steps to reproduce the behavior:
- Checkout any tag
- Build the mermaid CLI
mmdc --version
- Notice the invalid version (the previous release)
Expected behavior
The version should match the version of the tag.
Hi @terlar
Well spotted.
I think the easiest way to fix the issue is to re-tag the code during the release in the pipeline.
Here is the code the sets the version in the package.json file:
Retagging after the file update would fix it. Or do you have another proposal?
Would you be interested in providing a fix to the problem?
I agree that re-tagging is the easiest solution. The downside is that it mutates the tag (although very briefly) and that we would have to figure out how to not then trigger the workflow again.
I guess the other option would be if there is another way to trigger a release and then do the tagging as part of the release. So if the trigger is a commit itself and then that will trigger the bumping, tagging and the release.
There is https://github.com/googleapis/release-please but perhaps that is too involved, too much of a change to the current process.
If we can come up with something I could assist in making it happen.
It is not a tag, that triggers a release in our workflow today. It is actually a published release event that triggers the pipeline. Creating/pushing a new tag should not start the workflow again. Link to the code code
When I create a new release, both creating a tag and publishing of the release (note) happens at the same time.
I hope that my input is not confusing :)