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

make this auto increment the version number #4

Open
michaelonz opened this issue May 30, 2024 · 2 comments
Open

make this auto increment the version number #4

michaelonz opened this issue May 30, 2024 · 2 comments

Comments

@michaelonz
Copy link

Hi There-
I have a suggestion for a possible new feature that would be helpful to a lot of devs:

Would it be possible to get this action to have a property to increment the version number and display version number for us by 1

E.G

currently the action has these properties:

uses: managedcode/MAUIAppVersion@v1
with:
csproj: 'path/to/my-project.csproj'
version: ${{ github.run_number }} # to keep value unique
displayVersion: '1.0.0'
printFile: true # optional

add 2 new (optional) properties of :

incrementVersion: true
incrementDisplayVersion: Build

incrementDisplayVersion can have Major / Minor / Build ( these correspond to which part of the version # to increase by one - eg in a display version they map to which position to increase by one in the version # eg 1.2.3 if I put build that is position 3 so version 1.2.3 would become 1.2.4)

incrementVersion: true increases the Version # that is currently in the proj file by 1.

NOTE: when these increment options are specified then you dont need to supply a version or display version to the action as it will read the existing ones and increase them.

so we have:

uses: managedcode/MAUIAppVersion@v1
with:
csproj: 'path/to/my-project.csproj'
version: ${{ github.run_number }} # to keep value unique
displayVersion: '1.0.0'
printFile: true # optional
incrementVersion: true
incrementDisplayVersion: Build

This will increment the current Version # in minor position by 1 and also increase the buildDisplayVersion by 1.

By adding this it will make doing releases of new builds a lot more seamless rather than the dev having to manually work out version numbers.

@KSemenenko
Copy link
Member

Nice, I love this idea

@michaelonz
Copy link
Author

One more thing - for incrementVersion: and incrementDisplayVersion can we also have a valid value of reuse.

What this would do is read the exisitng version and just reuse it (means i dont have to specify a version#).

What i am thinking is this:

In my comments when i check in i can add a tag of REUSE to rerun the build with the existing numbers without increasing them - this is for cases where the last build had failed with a error and i want to rerun it with the next commit.

So i would call it with these properties:
incrementVersion: reuse
incrementDisplayVersion: reuse

So if i want to do a build and increment the version #'s then i would use: (once again i would trigger these properties from a comment):

incrementVersion: true
incrementDisplayVersion: Build

This means the dev can decide to reuse the last increased version or increase them based on a check in comment.

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