How to use branch name in release name?

Zelin Feng's Avatar

Zelin Feng

09 Oct, 2017 10:02 AM

This is my deployment section in appveyor.yml

deploy:
  - provider: GitHub
    release: my-app-{branch}
    ... other attributes

Everything works fine, except that the {branch} in 'release'(line 3) doesn't get substituted with the branch name.
The tag name is something like v0.1.0 and appveyor treats it as the current branch name. So how to embed
this tag name inside release name?

  1. 1 Posted by Ilya Finkelshte... on 09 Oct, 2017 02:10 PM

    Ilya Finkelshteyn's Avatar

    Please use APPVEYOR_REPO_BRANCH environment variable.
    {branch] is local shortcut local available only in build versioning and assemblyinfo/.csproj patching. Sorry for confusion. For environment variables you can use any of the following syntax:

    • $(variable) - MSBuild-like syntax
    • %variable% - Batch-like syntax
    • ${variable} - Shell-like syntax
  2. 2 Posted by Zelin Feng on 09 Oct, 2017 02:27 PM

    Zelin Feng's Avatar

    Thanks a lot! It works now.

  3. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:20 AM.

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