forked from purescript/purescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
78 lines (71 loc) · 2.65 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
platform: x64
version: '{build}'
environment:
# Keep the path as short as possible, just in case.
STACK_ROOT: c:\s
STACK_VER: 1.5.1
RELEASE_USER: purescript
RELEASE_REPO: purescript
branches:
# Only build master and tagged versions, i.e. not feature branches; feature
# branches already get built after opening a pull request.
#
# Note that, unlike Travis CI, there is no need for a semver tag regexp
# here, as AppVeyor seems to build all tags which are reachable from any
# of the branches listed below.
only:
- master
cache:
- c:\s -> appveyor/cache-buster.txt
install:
- git submodule update --init
- ps: Install-Product node 6
- npm install -g bower
- ps: |
New-Item -ItemType Directory -Force -Path C:\tools
$env:Path += ";C:\tools"
$stackRelease = "stack-$env:STACK_VER-windows-x86_64"
$downloadUrl = "https://github.com/commercialhaskell/stack/releases/download/v$env:STACK_VER/$stackRelease.zip"
(New-Object Net.WebClient).DownloadFile($downloadUrl, 'c:\tools\stack.zip')
pushd c:\tools
7z x c:\tools\stack.zip stack.exe
popd
- stack --no-terminal --verbosity=error setup 1>stack-setup.log 2>&1 || type stack-setup.log
build_script:
# Override the default build script.
# In PowerShell it seems to be necessary to redirect stderr to stdout because
# any text sent to stderr seems to cause appveyor to think the build has
# failed.
- echo ""
test_script:
- ps: |
$stack_extra_flags=""
if ($env:APPVEYOR_REPO_TAG_NAME)
{
$stack_extra_flags+="--flag purescript:RELEASE"
}
echo "stack_extra_flags = $stack_extra_flags"
# This is an incredibly stupid workaround for a bizarre PowerShell
# 'feature' where any text printed to stderr is treated as the command
# having failed; see
# https://stackoverflow.com/questions/10666101/lastexitcode-0-but-false-in-powershell-redirecting-stderr-to-stdout-gives-n
cmd /c "stack --jobs=1 --no-terminal test --pedantic $stack_extra_flags 2>&1"
on_success:
- ps: |
function UploadFile
{
github-release upload --user $env:RELEASE_USER --repo $env:RELEASE_REPO --tag $env:APPVEYOR_REPO_TAG_NAME --file $args[0] --name $args[0]
}
if ($env:APPVEYOR_REPO_TAG_NAME)
{
bash ./bundle/build.sh win64
(New-Object Net.WebClient).DownloadFile('https://github.com/aktau/github-release/releases/download/v0.6.2/windows-amd64-github-release.zip', 'c:\tools\github-release.zip')
pushd c:\tools
7z x github-release.zip bin/windows/amd64/github-release.exe
Copy-Item bin/windows/amd64/github-release.exe github-release.exe
popd
pushd bundle
UploadFile win64.tar.gz
UploadFile win64.sha
popd
}