# Notes:
#   - Minimal appveyor.yml file is an empty file. All sections are optional.
#   - Indent each level of configuration with 2 spaces. Do not use tabs!
#   - All section names are case-sensitive.
#   - Section names should be unique on each level.

#---------------------------------#
#      general configuration      #
#---------------------------------#

# version format
version: 1.6.0.{build}-testing

shallow_clone: true
clone_depth: 1

cache:
  # Cache downloaded pip packages.
  - "C:\\Users\\appveyor\\AppData\\Local\\pip"


#---------------------------------#
#    environment configuration    #
#---------------------------------#

# Operating system (build VM template)
os: Windows Server 2012

environment:
  matrix:
    - PYTHON: "c:\\python27"
      WHL_ARCH: 32

    - PYTHON: "c:\\python27-x64"
      WHL_ARCH: _amd64

  global:
    MCEDIT_BUILD_VERSION: $(version)
#    MCEDIT_BUILD_VERSION: 1.6.0.{build}-testing


# scripts that run after cloning repository
install:
  # by default, all script lines are interpreted as batch
  - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
  - "%PYTHON%\\python.exe -m pip install wheel"
  -
  - pip install -r requirements.txt
  - pip install pyinstaller
  - python setup.py all

build_script:
  - pyinstaller mcedit-ci.spec -y

artifacts:
  - path: ./dist/*.zip

deploy:
  release: 'MCEdit-Unified $(APPVEYOR_BUILD_VERSION)'
  description: '### This is a testing build! \n### Use precautions, backup all data, do not use unless you know what you are doing. Read the [Warning and FAQ](https://github.com/Podshot/MCEdit-Unified-Preview/blob/master/README.md#warnings) page before downloading.\n\nBuilt on commit: $(APPVEYOR_REPO_COMMIT)'
  provider: GitHub
  auth_token: "$(GITHUB_AUTH_TOKEN)"
  artifact: /dist\/mcedit-unified-.*\.zip/
  draft: false
  prerelease: true
  force_update: true
  repository: Podshot/MCEdit-Unified-Preview