-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use appveyor to build, test and deploy in windows (#785)
- Loading branch information
1 parent
095ee6d
commit a2a7985
Showing
1 changed file
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |