Reset the build number automatically (yml)

Yuki Hyou's Avatar

Yuki Hyou

16 May, 2014 06:41 AM

Hi guys,

I'm using the yml config at the moment, and trying to get the build numbers to reset once the major/minor versions are incremented. I know I can go into the web interface and reset it manually, but that is tedious. I want it to auto-reset when I manually change the major/minor numbers in my yml:

1.0.{0}
1.0.{1}
1.0.{2}
1.0.{3}
1.1.{0}

I understand that if you try to use a number that's already taken (not unique), the number will be auto incremented to the next available unique entry. If this is the case, could I simply specify something in my yml to reset the build number to 0, so it will start at 0 on each build, which should result in the functionality above?

I've searched the forum and Google, as well as looked through the documentation, but can't see any way to reset the build count without using the web interface.

Please advise.

  1. Support Staff 1 Posted by Feodor Fitsner on 16 May, 2014 11:57 PM

    Feodor Fitsner's Avatar

    There is a better way setting build number as you want: http://www.appveyor.com/docs/build-agent-api#update-build-details

  2. 2 Posted by Yuki Hyou on 17 May, 2014 02:04 AM

    Yuki Hyou's Avatar

    This seems to be a way of setting the whole version number myself, which I don't particularly want to do. I am happy with using the default 'increment by one' version numbers in these projects, at least for now, and simply changing the version header in the appveyor.yml when pushing updates hotfixes/versions/etc.

    In my post, I am referring to this particular comment:

    You can have "through" builds numbering in which major and minor parts of the version are changing and the build number is never reset or you can reset the build number for every new version. -- http://www.appveyor.com/docs/build-configuration#build-versioning

    It would seem to indicate that there is a way to choose this behavior, which would be perfect, however I can't find anything that would suggest any entries for appveyor.yml that would influence the build number generation.

  3. Support Staff 3 Posted by Feodor Fitsner on 17 May, 2014 10:43 PM

    Feodor Fitsner's Avatar

    Oh, that phrase means you can reset build number on UI.

  4. 4 Posted by Yuki Hyou on 18 May, 2014 01:16 AM

    Yuki Hyou's Avatar

    Ah, I see. In that case, is it possible request adding a 'reset build number to zero' option into the yml parser?

  5. Support Staff 5 Posted by Feodor Fitsner on 18 May, 2014 02:12 AM

    Feodor Fitsner's Avatar

    Sure, what would be the trigger to reset build number to zero then?

  6. 6 Posted by Yuki Hyou on 18 May, 2014 02:21 AM

    Yuki Hyou's Avatar

    How about something simple like a new entry:

    buildnumber: through|reset|force: #

    This is presuming that it would respect the 'if not unique, then find lowest unique number' behavior that resetting it through the web interface would.

    through = current behavior reset = try {build}=1 and increment until unique version found force: # = try {build}=# and error if version not unique

    Personally, I would just leave it on reset which would result in the numbering scheme in my first post (with the exception of {0} because I noticed after posting that {1} is the lowest value), however this should cover all use cases?

  7. Support Staff 7 Posted by Feodor Fitsner on 18 May, 2014 06:58 PM

    Feodor Fitsner's Avatar

    Well, that's an interesting suggestion and I think it's pretty doable. I'm going to add it to issues list. Thanks!

    - Feodor

  8. 8 Posted by Yuki Hyou on 20 May, 2014 06:58 AM

    Yuki Hyou's Avatar

    Thanks! :)

  9. 9 Posted by micdenny on 19 Aug, 2015 02:46 PM

    micdenny's Avatar

    I don't see the issue, what about this feature?

  10. 10 Posted by Chris Simmons on 19 Feb, 2016 12:25 AM

    Chris Simmons's Avatar

    Hello Feodor, can you tell us if this feature will be added? I'm using the build number as my patch number for semantic versioning and would love it if AppVeyor would be able to detec a new major or minor version and reset the build number to 0. I think Yuki Hyou's solution above would be perfect, except for reset, the initially-tried value would be 0 and not 1.

  11. Support Staff 11 Posted by Feodor Fitsner on 21 Feb, 2016 01:51 AM

    Feodor Fitsner's Avatar

    We've added a new REST API method to update next build number: http://www.appveyor.com/docs/api/projects-builds#update-project-bui...

  12. 12 Posted by Benjamin Abt on 21 Sep, 2016 07:56 PM

    Benjamin Abt's Avatar

    Is it possible right now to auto reset the build number? a rest api call is not automatically integrateable in open source projects.

    My request:
    If I increase Major or Minor the Build number should be reset automatically to 0.
    Optional property of yml like Yuki Hyou here said in 2014.

  13. 13 Posted by bazzilic on 19 Jun, 2017 09:38 AM

    bazzilic's Avatar

    I would also like this feature to be available through YAML config

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac