Build condition

uilianries's Avatar

uilianries

14 Jan, 2018 02:08 PM

Hi!

I would like to build my project in two ways:

  • First I only want to build when I have a push on master
  • And I want to execute a totally different flow when I have a tag.

I can't figure out some way to split my build flow. All tags are created by master, so the branch repo name is master in both cases.
This is my appveyor file:

-
  skip_non_tags: true
  build: false
  environment:
    PYTHON: "C:\Python27"
    PYTHON_VERSION: "2.7.8"
    PYTHON_ARCH: "32"

matrix:
  - MINGW_CONFIGURATIONS: "4.9@x86_64@seh@posix, 4.9@x86_64@sjlj@posix, 4.9@x86@sjlj@posix, 6.3@x86_64@seh@posix, 7.1@x86_64@seh@posix"
  - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
    CONAN_VISUAL_VERSIONS: 12
  - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
    CONAN_VISUAL_VERSIONS: 14
  - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
    CONAN_VISUAL_VERSIONS: 15



install: - set PATH=%PATH%;%PYTHON%/Scripts/ - pip.exe install conan --upgrade - pip.exe install conan_package_tools - conan user
test_script: - python conan/build.py
- branches: only: - master
os: Visual Studio 2015 environment: global: # Workaround for https://github.com/conda/conda-build/issues/636 PYTHONIOENCODING: UTF-8 CONDA_INSTALL_LOCN: "C:\Miniconda35-x64" matrix: - CMAKE_VS_VERSION: "10 2010" - CMAKE_VS_VERSION: "14 2015" platform: - x86 - x64 configuration: - Debug - Release before_build: - cmake -G"Visual Studio %CMAKE_VS_VERSION%" - del "C:\Program Files (x86)\MSBuild\14.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets"
build: project: ALL_BUILD.vcxproj verbosity: minimal
install: - set PATH=%CONDA_INSTALL_LOCN%;%CONDA_INSTALL_LOCN%\scripts;%PATH%;
test_script: - "cd FlatBuffers.Test" - "msbuild.exe /property:Configuration=Release;OutputPath=tempcs /verbosity:minimal FlatBuffers.Test.csproj" - "tempcs\FlatBuffers.Test.exe"
artifacts: - path: $(CONFIGURATION)\flatc.exe name: flatc.exe - path: tests\GeneratedMyGameCode.zip name: GeneratedMyGameCode.zip

As you can see, I have two flows. The first one uses skip_non_tags to build tags. However, the second one uses only: master and this rue will include the tag.

My question is how to build the first one ONLY for tags and the second one ONLY on master and non-tag.

Regards!

  1. 1 Posted by Ilya Finkelshte... on 14 Jan, 2018 03:14 PM

    Ilya Finkelshteyn's Avatar

    I think you can try annotated tag to make this scenario work. With normal (lightweight tag) branch name is preserved in GitHub webhook so AppVeyor will build master branch configuration. With annotated tag original branch name does not exist in GitHub webhook and AppVeyor uses tag name as a branch. Therefore it should build "fall back" configuration.

  2. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:26 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