NuGet publishing using multiple images

Luca Piccioni's Avatar

Luca Piccioni

31 Oct, 2017 10:37 PM

Having the following environment:

environment:
  matrix:
    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
      SLN_PATH: OpenGL.Net_VC14.sln
      PUBLISH_NUGET: true
    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
      SLN_PATH: OpenGL.Net_VC15.sln
      PUBLISH_NUGET: false

How I can configure the deploy section for publishing artifacts conditionally?
Essentially I want to control which image is used to publish artifacts, while testing on other images. I doubt that artifacts are published twice...

The complete configuration can be found at https://github.com/luca-piccioni/OpenGL.Net/blob/master/.appveyor.yml.

  1. Support Staff 1 Posted by Ilya Finkelshte... on 31 Oct, 2017 11:02 PM

    Ilya Finkelshteyn's Avatar

    The same way as you did with tags, using conditional deployment.

    deploy:
      - provider: NuGet
        . . .
        on:
          appveyor_repo_tag: true
          PUBLISH_NUGET: true
    

    Also I would recommend to condition each nuget pack statement with if %PUBLISH_NUGET%==true to save some build time.

    P.S. I understand the idea with publish_nuget: %PUBLISH_NUGET% but this setting cannot be substituted with environment variable right now.

  2. 2 Posted by Luca Piccioni on 31 Oct, 2017 11:35 PM

    Luca Piccioni's Avatar

    Many thanks. Now it seems so obvious...

  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