Force Pre-release version number in branch

Allan's Avatar

Allan

02 Jan, 2019 10:04 AM

Hi,
New to yml files and AppVeyor but so far the experience has been awesome. My question relates to how I can setup the version number depending on the branch type. e.g. master always builds release versions, but any other branch will change the patch and append a pre-release value so that when the nuget package is built, it deploys to NuGet.org and will be displayed as a pre-release package.
I don't want to manually have to change the file version or package versions as part of checkins, etc.
Is this possible, can someone help with the yml too?
thanks in advance.

  1. Support Staff 1 Posted by Owen McDonnell on 02 Jan, 2019 05:29 PM

    Owen McDonnell's Avatar

    Hi, Allan.
    It's hard to give too specific advice without seeing your current configuration file but you can find information about using the build worker API to alter build details here.
    You could combine that with some logic that checks for the value of APPVEYOR_REPO_BRANCH (one of the environment variables set by AppVeyor for every build) and renames version accordingly.
    Or, instead of including logic to determine which branch is building, you could make use of conditional build configuration as described in this blog post.
    Here is a hypothetical example.

    for:
    -
      branches:
        only: master
      before_build:
        - appveyor UpdateBuild -Version <release-version>
    -
      branches:
        only: /dev-.*/
      before_build:
        - appveyor UpdateBuild -Version <pre-release-version>
    
  2. Ilya Finkelshteyn closed this discussion on 04 Mar, 2019 09:01 PM.

Comments are currently closed for this discussion. You can start a new one.

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

 

26 Sep, 2024 03:49 PM
26 Sep, 2024 09:02 AM
25 Sep, 2024 07:07 PM
24 Sep, 2024 08:39 PM
24 Sep, 2024 06:47 AM
20 Sep, 2024 05:50 PM