version: '6.0.45.{BUILD}'

image: Visual Studio 2017

install:
    - appveyor-retry choco install InnoSetup
    - git clone https://github.com/c-testsuite/c-testsuite.git
    - copy c-testsuite\tests\single-exec tests\c-testsuite > NUL
    - cd \
    - 7z x projects\orangec\src\cc386.zip *
    - set PATH=c:\orangec\bin;c:\cc386\bin;%PATH%;C:\Program Files (x86)\Inno Setup 6
    - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
    - set PATH=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
    - set ORIGPATH=%PATH%
    - set ORANGEC=c:\ORANGEC
    - set LADSOFT_DEV=c:\cc386

branches:
   only:
     - master
     - /v\d*\.\d*\.\d*\.\d*/

configuration:
     - MINGW64 THEN WITH STATIC LIB
     - CLANG THEN WITH STATIC LIB
     - MSVC THEN WITH STATIC LIB
     - MSVC THEN WITH LSCRTL
     - MSVC THEN VIA ASSEMBLY
     - MSVC THEN WITH DEBUG
     - CODE ANALYZER TEST
     - MSIL COMPILER
     - MS WITH PDB

for:
-
      matrix:
            only:
                - configuration: MSVC THEN WITH STATIC LIB
      environment:
          BUILD_PROFILE: MS
      deploy:
          release: Orange C-$(APPVEYOR_REPO_TAG_NAME)
          description: 'Current Release'
          provider: GitHub
          auth_token:
              secure: gOXANm+uz1YSqzv6tHI8/UAlAbA/ofp6o1NNxA+dsVX/jnTZioWTVD3f8Q8S6Un7
          artifact: /.*/
          draft: false
          prerelease: false
          on:
              branch: /v\d*\.\d*\.\d*\.\d*/
              APPVEYOR_REPO_TAG: true
-
      matrix:
            only:
                - configuration: MINGW64 THEN WITH STATIC LIB
      environment:
          BUILD_PROFILE: MINGW64
-
      matrix:
            only:
                - configuration: CLANG THEN WITH STATIC LIB
      environment:
          BUILD_PROFILE: CLANG
-
      matrix:
            only:
                - configuration: MSIL COMPILER
      environment:
          BUILD_PROFILE: OCCIL
-
      matrix:
            only:
                - configuration: MS WITH PDB
      environment:
          BUILD_PROFILE: MSDEBUGBUILD
          MSPDB: YES
-
      matrix:
            only:
                - configuration: MSVC THEN VIA ASSEMBLY
      environment:
          BUILD_PROFILE: MS
          VIAASSEMBLY: YES
-
      matrix:
            only:
                - configuration: MSVC THEN WITH LSCRTL
      environment:
          BUILD_PROFILE: MS
          LSCRTL: YES
-
      matrix:
            only:
                - configuration: MSVC THEN WITH DEBUG
      environment:
          BUILD_PROFILE: MS
          WITHDEBUG: YES
-
      matrix:
            only:
                - configuration: CODE ANALYZER TEST
      environment:
          BUILD_PROFILE: CODEANALYZER


skip_commits:
  files:
    - '**/*.txt'
    - '**/*.doc'
    - '**/*.md'
    - '**/*.html'
 
build_script:
# the appveyor virtual machine reported two processors, so, lets try running parallel compile!
        - cmd: |
              cd ..\..
              move projects\orangec .
              mkdir \orangec\temp
              cd orangec\src
              call build.bat
              cd ..\.. 
              move orangec projects
              cd projects\orangec

artifacts:
  - path: "dist\\*.*"
    name: releasefiles

