<commit_before># version format
version: 2017.2.{build}

# cache the "downloads" folder in the build folder
# refresh cache, if appveyor.yml changes
# trigger cache refresh line: x
#cache:
#  - downloads -> appveyor.yml

# scripts that are called at very beginning, before repo cloning
init:
  - date /T & time /T
  - git config --global core.autocrlf input

install:
  # Upgrade to the latest version of pip to avoid "out of date" warnings
  - pip install --disable-pip-version-check --user --upgrade pip
  - pip install pyyaml polib pillow
  
before_build: 
  # download
  - build-scripts\1-download.bat
  - dir "%APPVEYOR_BUILD_FOLDER%\downloads"
  # extract
  - build-scripts\2-extract.bat
  - dir "%APPVEYOR_BUILD_FOLDER%\extracted"
  # Unknown Horizons - create translation files
  - set PATH=%PATH%;C:\projects\uh-installer\build-tools\gettext\bin
  - cd "%APPVEYOR_BUILD_FOLDER%\extracted\unknown-horizons\development"
  - python compile_translation_win.py
  # Unknown Horizons - create atlas files
  - cd "%APPVEYOR_BUILD_FOLDER%\extracted\unknown-horizons"
  - python horizons\engine\generate_atlases.py 1024
  # Unknown Horizons - stripdown 
  # remove all .pyc and .pyo files (rmpyc.sh)
  - del /S /Q *.pyc
  - del /S /Q *.pyo
  - del /Q unknown-horizons.wpr
  - del /Q stage_build_mac.py
  - del /Q CONTRIBUTING.md
  - rd /S /Q tests
  # These files/folders may or may not be present
  #- dir * /s/b | findstr __pycache__ | attrib +h +s +r
  #- rd /S /Q __pycache__
  - del /S /Q "po\*.po~"
  # Removing non-atlas graphics...
  - rd /S /Q content\gfx\base
  - rd /S /Q content\gfx\buildings
  - rd /S /Q content\gfx\units
  - rd /S /Q content\gfx\terrain
  # Not needed folder for gamer version of installer
  - rd /S /Q development
  # Change uh config from dev to release
  - set PATH=%PATH%;C:\projects\uh-installer\build-tools\sed\bin\
  - echo "Unsetting dev version..."
  - cd "%APPVEYOR_BUILD_FOLDER%\extracted\unknown-horizons\"
  - sed -i 's/IS_DEV_VERSION\s=\sTrue/IS_DEV_VERSION = False/g' horizons\constants.py
  - sed -i "s/RELEASE_VERSION = .*/RELEASE_VERSION = u'2017.2'/g" horizons/constants.py
  # copy
  - cd "%APPVEYOR_BUILD_FOLDER%
  - build-scripts\3-copy.bat
  - dir "%APPVEYOR_BUILD_FOLDER%\repackage"
  # stripdown
  - build-scripts\4-stripdown.bat
  - dir "%APPVEYOR_BUILD_FOLDER%\repackage"
  
build_script:
  - build-tools\innosetup\iscc /DAPP_VERSION=%APPVEYOR_BUILD_VERSION% installer\uh.iss

after_build:
  - dir "%APPVEYOR_BUILD_FOLDER%\"
  - appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\_build\Unknown-Horizons-%APPVEYOR_BUILD_VERSION%-Setup-VC14-x86.exe"

artifacts:
  - path: '%APPVEYOR_BUILD_FOLDER%\_build\Unknown-Horizons-*.exe'
    name: UH-Installer

# deploy to Github Releases on tag push
deploy:
  provider: GitHub
  release: 'Unknown-Horizons $(APPVEYOR_REPO_TAG_NAME)'
  tag: $(APPVEYOR_REPO_TAG_NAME)
  description: '[**Changelog**](https://github.com/unknown-horizons/unknown-horizons/blob/master/doc/CHANGELOG.md)'
  artifact: UH-Installer
  draft: false
  prerelease: false
  force_update: true               # overwrite files of existing release on GitHub
  on:
    branch: master                 # release from master branch only
    appveyor_repo_tag: true        # deploy on tag push only
  auth_token:                      # encrypted token from GitHub
    secure: <KEY>
    <commit_msg>Try to fix build<commit_after># version format
version: 2017.2.{build}

# cache the "downloads" folder in the build folder
# refresh cache, if appveyor.yml changes
# trigger cache refresh line: x
#cache:
#  - downloads -> appveyor.yml

# scripts that are called at very beginning, before repo cloning
init:
  - date /T & time /T
  - git config --global core.autocrlf input

install:
  # Upgrade to the latest version of pip to avoid "out of date" warnings
  - pip install --disable-pip-version-check --user --upgrade pip
  - pip install pyyaml polib pillow
  
before_build: 
  # download
  - build-scripts\1-download.bat
  - dir "%APPVEYOR_BUILD_FOLDER%\downloads"
  # extract
  - build-scripts\2-extract.bat
  - dir "%APPVEYOR_BUILD_FOLDER%\extracted"
  # Unknown Horizons - create translation files
  - set PATH=%PATH%;C:\projects\uh-installer\build-tools\gettext\bin
  - cd "%APPVEYOR_BUILD_FOLDER%\extracted\unknown-horizons\development"
  - python compile_translation_win.py
  # Unknown Horizons - create atlas files
  - cd "%APPVEYOR_BUILD_FOLDER%\extracted\unknown-horizons"
  - python horizons\engine\generate_atlases.py 1024
  # Unknown Horizons - stripdown 
  # remove all .pyc and .pyo files (rmpyc.sh)
  - del /S /Q *.pyc
  - del /S /Q *.pyo
  - del /Q unknown-horizons.wpr
  - del /Q stage_build_mac.py
  - del /Q CONTRIBUTING.md
  - rd /S /Q tests
  # These files/folders may or may not be present
  #- dir * /s/b | findstr __pycache__ | attrib +h +s +r
  #- rd /S /Q __pycache__
  - del /S /Q "po\*.po~"
  # Removing non-atlas graphics...
  - rd /S /Q content\gfx\base
  - rd /S /Q content\gfx\buildings
  - rd /S /Q content\gfx\units
  - rd /S /Q content\gfx\terrain
  # Not needed folder for gamer version of installer
  - rd /S /Q development
  # Change uh config from dev to release
  - set PATH=%PATH%;C:\projects\uh-installer\build-tools\sed\bin\
  - echo "Unsetting dev version..."
  - cd "%APPVEYOR_BUILD_FOLDER%\extracted\unknown-horizons\"
  - sed -i 's/IS_DEV_VERSION\s=\sTrue/IS_DEV_VERSION = False/g' horizons\constants.py
  - sed -i "s/RELEASE_VERSION = .*/RELEASE_VERSION = u'2017.2'/g" horizons/constants.py
  # copy
  - cd "%APPVEYOR_BUILD_FOLDER%
  - build-scripts\3-copy.bat
  - dir "%APPVEYOR_BUILD_FOLDER%\repackage"
  # stripdown
  - build-scripts\4-stripdown.bat
  - dir "%APPVEYOR_BUILD_FOLDER%\repackage"
  
build_script:
  - build-tools\innosetup\iscc /DAPP_VERSION=%APPVEYOR_BUILD_VERSION% installer\uh.iss

after_build:
  - dir "%APPVEYOR_BUILD_FOLDER%\"
  - appveyor PushArtifact "%APPVEYOR_BUILD_FOLDER%\_build\Unknown-Horizons-%APPVEYOR_BUILD_VERSION%-Setup-VC14-x86.exe"

artifacts:
  - path: _build\Unknown-Horizons-$(APPVEYOR_BUILD_VERSION)-Setup-VC14-x86.exe
    name: UH-Installer

# deploy to Github Releases on tag push
deploy:
  provider: GitHub
  release: 'Unknown-Horizons-$(APPVEYOR_REPO_TAG_NAME)'
  tag: $(APPVEYOR_REPO_TAG_NAME)
  description: '[**Changelog**](https://github.com/unknown-horizons/unknown-horizons/blob/master/doc/CHANGELOG.md)'
  artifact: UH-Installer
  draft: false
  prerelease: false
  force_update: true               # overwrite files of existing release on GitHub
  on:
    branch: master                 # release from master branch only
    appveyor_repo_tag: true        # deploy on tag push only
  auth_token:                      # encrypted token from GitHub
    secure: <KEY>
    
{'fraction_non_alphanumeric': 0.11581920903954802, 'fraction_numerical': 0.007136485280999108, 'mean_word_length': 3.157601977750309, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '47568', 'n_tokens_mistral': 2533, 'n_tokens_neox': 2436, 'n_words': 586}