diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..dfaf19a93 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,73 @@ +version: 1.0.{build} + +branches: + only: + - master + - /.*appveyor.*/ + - /\d*\.\d*\.\d*/ + +environment: + STACK_ROOT: C:\sr + STACK_VERSION: 1.9.3 + + matrix: + - STACK_YAML: stack.yaml + - STACK_YAML: stack-lts-6.yaml + +install: + - choco install -y haskell-stack --version %STACK_VERSION% + - stack setup > nul + - cd %APPVEYOR_BUILD_FOLDER% + - git submodule update --init --recursive + +cache: + - C:\sr -> '%STACK_YAML%' + - .stack-work -> '%STACK_YAML%' + - dhall\.stack-work -> '%STACK_YAML%' + - dhall-json\.stack-work -> '%STACK_YAML%' + - dhall-text\.stack-work -> '%STACK_YAML%' + - dhall-bash\.stack-work -> '%STACK_YAML%' + +build_script: + - stack build + - stack install --local-bin-path bin + - if /I "%APPVEYOR_REPO_TAG%" EQU "true" (set DEPLOY_TAG=%APPVEYOR_REPO_TAG_NAME%) else (set DEPLOY_TAG=%APPVEYOR_REPO_COMMIT:~0,5%) + - set DEPLOY_SUFFIX=%DEPLOY_TAG%-x86_64-windows.zip + - 7z a "bin\dhall-%DEPLOY_SUFFIX%" "%APPVEYOR_BUILD_FOLDER%\bin\dhall.exe" + # dhall-json cannot be built with lts-6 + - if exist "%APPVEYOR_BUILD_FOLDER%\bin\dhall-to-json.exe" ( 7z a "bin\dhall-json-%DEPLOY_SUFFIX%" "%APPVEYOR_BUILD_FOLDER%\bin\dhall-to-json.exe" ) + - if exist "%APPVEYOR_BUILD_FOLDER%\bin\dhall-to-yaml.exe" ( 7z a "bin\dhall-json-%DEPLOY_SUFFIX%" "%APPVEYOR_BUILD_FOLDER%\bin\dhall-to-yaml.exe" ) + - 7z a "bin\dhall-text-%DEPLOY_SUFFIX%" "%APPVEYOR_BUILD_FOLDER%\bin\dhall-to-text.exe" + - 7z a "bin\dhall-bash-%DEPLOY_SUFFIX%" "%APPVEYOR_BUILD_FOLDER%\bin\dhall-to-bash.exe" + +for: +- + matrix: + except: + # stack is not able to build test dependencies with lts-6 + - STACK_YAML: stack-lts-6.yaml + + test_script: + - stack test dhall:tasty + - stack test dhall-json + - stack test dhall-text + - stack test dhall-bash + +artifacts: + - path: bin\dhall-%DEPLOY_SUFFIX% + name: dhall + - path: bin\dhall-json-%DEPLOY_SUFFIX% + name: dhall-json + - path: bin\dhall-text-%DEPLOY_SUFFIX% + name: dhall-text + - path: bin\dhall-bash-%DEPLOY_SUFFIX% + name: dhall-bash + +deploy: + - provider: GitHub + auth_token: + secure: Gs/tiz6Jtg/Zjd4zGHDhuSv4Y9a+zJ574LWwzOe2bvZNGX/M8XupkxdGmBpDlnOf + artifact: dhall, dhall-json, dhall-text, dhall-bash + on: + APPVEYOR_REPO_TAG: true + STACK_YAML: stack.yaml