Environment Variable as tag name

nahuel's Avatar

nahuel

24 Jan, 2019 03:48 PM

Hello, i started using AppVeyor for deploying an Electron App to Github Releases, so, for getting the version name, i'm doing:

before_deploy:
  - sh: export VERSION="$(node -p "require('./package.json').version")"
deploy:
  - tag: $(VERSION)
    provider: GitHub
    on:
      branch: master

No matter if i use $(VERSION), ${VERSION} or %VERSION% it would not transpile my env var properly, how this can be achieved?

  1. Support Staff 1 Posted by Ilya Finkelshte... on 24 Jan, 2019 11:21 PM

    Ilya Finkelshteyn's Avatar

    Thanks for the report. Seems like a bug. Tracking it here. As a workaround, please move export VERSION to after_build or build_script script or any other stage which happens earlier than deployment. Also I would recommend adding echo $VERSION after export VERSION to ensure value is OK.

  2. 2 Posted by nahuel on 24 Jan, 2019 11:26 PM

    nahuel's Avatar

    I'll give it a try, aside of that, which of the three ways of replacing values with env variables is the correct on the appveyor.yml file?

  3. Support Staff 3 Posted by Ilya Finkelshte... on 25 Jan, 2019 02:13 AM

    Ilya Finkelshteyn's Avatar

    All 3 ($(VERSION), ${VERSION} and %VERSION%) will work.

  4. 4 Posted by nahuel on 25 Jan, 2019 04:38 AM

    nahuel's Avatar

    I think that the problem rely on me trying to use sh scrips on a windows build, i was expecting to being processed using git bash or WSL, but in fact they're ignored at all. By replacing them with proper batch commands everything worked properly

  5. Support Staff 5 Posted by Ilya Finkelshte... on 25 Jan, 2019 08:45 AM

    Ilya Finkelshteyn's Avatar

    Ah it was Windows build :) But you helped find a bug in Linux build agent!

  6. Ilya Finkelshteyn closed this discussion on 27 Mar, 2019 09:00 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