aboutsummaryrefslogtreecommitdiff
path: root/appveyor.yml
blob: 2fc7f299b45370c5bb3d5ea04b20b7d999a5df91 (plain)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
image: Visual Studio 2013
clone_folder: "c:\\pandoc"
environment:
  global:
    WIXBIN: "c:\\Program Files (x86)\\WiX Toolset v3.11\\bin"
    STACK_BUILD_OPTS: "--no-terminal -j1 --no-terminal --test --local-bin-path=.\\windows"
    # see #4201, https://github.com/haskell-tools/haskell-tools/issues/277
  matrix:
  - STACK_VERSION: "windows-i386"
    STACK_ROOT: "c:\\sr32"
    STACK_YAML: "stack.lts11.yaml"
    STACK: "%STACK_ROOT%\\stack.exe"
    STACK_FLAGS: "--flag=hslua:lua_32bits"
    ARCH: "x86"
  - STACK_VERSION: "windows-x86_64"
    STACK_ROOT: "c:\\sr64"
    STACK_YAML: "stack.lts11.yaml"
    STACK: "%STACK_ROOT%\\stack.exe"
    STACK_FLAGS: ""
    ARCH: "x64"
  - STACK_VERSION: "windows-i386"
    STACK_ROOT: "c:\\sr32"
    STACK_YAML: "stack.yaml"
    STACK: "%STACK_ROOT%\\stack.exe"
    STACK_FLAGS: "--flag=hslua:lua_32bits"
    ARCH: "x86"
  - STACK_VERSION: "windows-x86_64"
    STACK_ROOT: "c:\\sr64"
    STACK_YAML: "stack.yaml"
    STACK: "%STACK_ROOT%\\stack.exe"
    STACK_FLAGS: ""
    ARCH: "x64"

skip_commits:
  files:
    - '*.md'
    - '*.txt'
    - '.travis.yml'
    - 'Makefile'
    - 'man/pandoc.1'
    - 'linux/*'
    - 'macos/*'

matrix:
  fast_finish: true

cache:
  - "%STACK_ROOT%"
  - "%WIXBIN%"
  # This is where stack install ghc by default, but we don't
  # cache it because it's too large:
  # - "c:\\Users\\appveyor\\AppData\\Local\\Programs\\stack"

# Note: to reset build cache, do the following in JavaScript
# console on appveyor:
# $.ajax({ url: 'https://ci.appveyor.com/api/projects/jgm/pandoc/buildcache', type: 'DELETE'})
# We don't do a normal C build, but build in test_script via stack
build: off

install:
  - '"%WIXBIN%"\candle -? || choco install wixtoolset'
  - |
      %STACK% --version || curl -ostack.zip -L --insecure http://www.stackage.org/stack/%STACK_VERSION% && 7z e stack.zip -o"%STACK_ROOT%" stack.exe

# before_test:

test_script:
  # The ugly echo "" hack is to avoid complaints about 0 being an invalid file
  # descriptor
  - |
      %STACK% setup --stack-yaml %STACK_YAML% > nul
      %STACK% path
      echo "" | %STACK% clean
      echo "" | %STACK% install --stack-yaml %STACK_YAML% %STACK_BUILD_OPTS% pandoc pandoc-citeproc %STACK_FLAGS%

after_test:
    # .\ in the stack commandline seems to be .\windows\ (where the stack-appveyor.yaml is)
  - cd windows
  - .\pandoc.exe -s --toc ..\MANUAL.txt -o MANUAL.html
  - .\pandoc.exe -s ..\COPYING.md -o COPYING.rtf
  - copy ..\COPYRIGHT COPYRIGHT.txt
  - 7z a "pandoc-%STACK_VERSION%.zip" pandoc.exe pandoc-citeproc.exe MANUAL.html COPYING.rtf
  - |
      set VERSION=
      for /f "tokens=1-2 delims= " %%a in ('.\pandoc.exe --version') do ( if not defined VERSION set "VERSION=%%b" )
      echo %VERSION%
      "%WIXBIN%\\candle" -arch %ARCH% -dVERSION=%VERSION% -dBINPATH=. *.wxs -out wixobj\
      "%WIXBIN%\\light" -sw1076 -ext WixUIExtension -ext WixUtilExtension -cultures:en-us -loc Pandoc-en-us.wxl -out "pandoc-%STACK_VERSION%.msi" wixobj\*.wixobj

artifacts:
  - path: 'windows\pandoc-%STACK_VERSION%.zip'
    name: exe
  - path: 'windows\pandoc-%STACK_VERSION%.msi'
    name: msi