Skip to content
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

Version bump happens after tagging #697

Open
terlar opened this issue Jun 11, 2024 · 3 comments
Open

Version bump happens after tagging #697

terlar opened this issue Jun 11, 2024 · 3 comments

Comments

@terlar
Copy link

terlar commented Jun 11, 2024

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:

  1. Checkout any tag
  2. Build the mermaid CLI
  3. mmdc --version
  4. Notice the invalid version (the previous release)

Expected behavior
The version should match the version of the tag.

@MindaugasLaganeckas
Copy link
Member

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:

- name: Commit new version to the repository

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?

@terlar
Copy link
Author

terlar commented Jul 11, 2024

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.

@MindaugasLaganeckas
Copy link
Member

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants