Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automatic commit tagging on pubspec.yaml version change for Flutter

For some time now I've been using tags on commits for my Flutter projects.

All I'm doing is adding tag manualy in Git/Log tab in Android Studio by right clicking new commit. I believe there must be an easy way to automate this, perhaps by writing some plugin that would run on commit that would open pubspec.yaml and read version key from it. If not plugin, basic script and running it every time (even manualy) should be able to do that as well.

My question is simple: Is there any solution to this problem already? Is there any tool that will help me achieve my goal without spending time on writing mentioned above plugin?

like image 552
Stahp Avatar asked Jun 27 '26 21:06

Stahp


1 Answers

It look's like you might just be a bit annoyed to use Android Studio to create the tag. I would recommend you:

Use the git command (git tag)

For example, git tag v.1.2.3.

To automate the version bumps for a new release, it looks like cider. If you use cider, apparently you can use: git tag $(cider version)

If you still want to automate it:

You have to parse the pubspec version field, and set e.g. version=$(getVersionFromPubspec).

Then use this variable in git tag $version.

like image 135
Ben Butterworth Avatar answered Jun 30 '26 13:06

Ben Butterworth



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!