Environment Variable as tag name

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. 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. 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. All 3 ($(VERSION), ${VERSION} and %VERSION%) will work.

  4. 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. 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