-
Notifications
You must be signed in to change notification settings - Fork 31
/
appveyor.yml
151 lines (141 loc) · 7.84 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
version: '{build}'
# In the end, all the efforts to make the date of the release progress didn't work.
# Just make the tag progress by deleting/recreating it but do not rebuild it.
branches:
except:
- latest
environment:
access_token:
secure: piEKiVbXBFm0fcZCREEII0pxZth77lewlfMc7qApggKVDXswkPaFJKM9eyGAaUy3
MSYS2_BASEVER: 20210604
MSYS2_ARCH: x86_64
MSYS2_URL: "http://repo.msys2.org/distrib/%MSYS2_ARCH%/msys2-base-%MSYS2_ARCH%-%MSYS2_BASEVER%.tar.xz"
MSYS2_ARCHIVE: msys2.tar.xz
MSYS2_SUBARCHIVE: msys2.tar
IPF_LINUX_URL: "http://www.softpres.org/_media/files:ipflib42_linux-i686.tar.gz"
PACKAGES: "ctags make zip diffutils %ARCH_PACKAGES%"
matrix:
- MINGW_DIR: "/mingw64"
WINARCH: win64
ARCH_PACKAGES: "mingw-w64-x86_64-ctags mingw-w64-x86_64-make mingw-w64-x86_64-gcc mingw-w64-x86_64-libpng mingw-w64-x86_64-freetype mingw-w64-x86_64-zlib mingw-w64-x86_64-SDL2"
IPF_WIN_URL: "http://www.softpres.org/_media/files:ipflib42_win_x64.zip"
IPF_DLL_SRC: "CAPSImg_x64.dll"
IPF_LICENCE_SRC: "LICENSE.txt"
RUN_E2E: true
- MINGW_DIR: "/mingw32"
WINARCH: win32
ARCH_PACKAGES: "mingw-w64-i686-ctags mingw-w64-i686-make mingw-w64-i686-gcc mingw-w64-i686-libpng mingw-w64-i686-freetype mingw-w64-i686-zlib mingw-w64-i686-SDL2"
IPF_WIN_URL: "http://www.softpres.org/_media/files:ipflib42_w32.zip"
IPF_DLL_SRC: "ipflib42_w32/CAPSImg.dll"
IPF_LICENCE_SRC: "ipflib42_w32/LICENSE.txt"
# I'm not sure why, e2e tests do not work on win32 (binary doesn't seem to work), only on win64 ...
RUN_E2E: false
install:
- if not exist "%MSYS2_ARCHIVE%" appveyor DownloadFile "%MSYS2_URL%" -FileName "%MSYS2_ARCHIVE%"
- 7z x "%MSYS2_ARCHIVE%"
- 7z x "%MSYS2_SUBARCHIVE%" > NUL
# msys2 advise to restart the shell after a first start
- msys64\usr\bin\bash -lc ""
# Allow three updates to fail (can happen with 'To complete this update all MSYS2 processes including this terminal will be closed.' killing bash itself.
- msys64\usr\bin\bash -lc "pacman --noconfirm -Suy" & exit 0
- msys64\usr\bin\bash -lc "pacman --noconfirm -Suy" & exit 0
- msys64\usr\bin\bash -lc "pacman --noconfirm -Suy" & exit 0
# The last one should succeed with nothing to update.
- msys64\usr\bin\bash -lc "pacman --noconfirm -Suy"
# Install packages. Three attempts as this can fail with network error sometims.
- msys64\usr\bin\bash -lc "for i in {1..3}; do pacman --noconfirm -S %PACKAGES% && break || sleep 15 ; done"
before_build:
- msys64\usr\bin\bash -lc "%MINGW_DIR%/bin/g++ --version"
- msys64\usr\bin\bash -lc "/usr/bin/make --version"
- echo "NUMBER_OF_PROCESSORS=%NUMBER_OF_PROCESSORS%"
build_script:
# TODO(cpitrat): Find a way to use %APPVEYOR_BUILD_FOLDER%, replacing \ by /
# ===================================
# = 1- Build and test in DEBUG mode =
# ===================================
- msys64\usr\bin\bash -lc "cd c:/projects/caprice32 && PATH=$PATH:%MINGW_DIR%/bin /usr/bin/make -j %NUMBER_OF_PROCESSORS% ARCH=%WINARCH% MINGW_PATH=\"%MINGW_DIR%\" WINE=\"\" debug"
- msys64\usr\bin\bash -lc "[ \"%RUN_E2E%\" == \"false\" ] || (cd c:/projects/caprice32 && PATH=$PATH:%MINGW_DIR%/bin /usr/bin/make -j %NUMBER_OF_PROCESSORS% ARCH=%WINARCH% MINGW_PATH=\"%MINGW_DIR%\" WINE=\"\" e2e_test)"
# ===================================
# 2- Build and test in RELEASE mode =
# ===================================
- msys64\usr\bin\bash -lc "cd c:/projects/caprice32 && PATH=$PATH:%MINGW_DIR%/bin /usr/bin/make -j %NUMBER_OF_PROCESSORS% ARCH=%WINARCh% clean"
- msys64\usr\bin\bash -lc "cd c:/projects/caprice32 && PATH=$PATH:%MINGW_DIR%/bin /usr/bin/make -j %NUMBER_OF_PROCESSORS% ARCH=%WINARCH% MINGW_PATH=\"%MINGW_DIR%\""
- msys64\usr\bin\bash -lc "cd c:/projects/caprice32 && PATH=$PATH:%MINGW_DIR%/bin /usr/bin/make -j %NUMBER_OF_PROCESSORS% ARCH=%WINARCH% MINGW_PATH=\"%MINGW_DIR%\" WINE=\"\" unit_test"
# =============================
# = 3- Build with IPF support =
# =============================
# Install IPF lib for linux (for build)
- msys64\usr\bin\bash -lc "cd c:/projects/caprice32 && wget \"%IPF_LINUX_URL%\" -O ipflib42_linux-i686.tar.gz && 7z x ipflib42_linux-i686.tar.gz && 7z x ipflib42_linux-i686.tar && cd i686-linux-gnu-capsimage/ && ln -s libcapsimage.so.4.2 libcapsimage.so.4 && ln -s libcapsimage.so.4.2 libcapsimage.so"
# Install IPF lib for windows
- msys64\usr\bin\bash -lc "wget \"%IPF_WIN_URL%\" && 7z x *ipflib*zip && cp %IPF_DLL_SRC% %MINGW_DIR%/bin/ && cp %IPF_LICENCE_SRC% c:/projects/caprice32/licenses/CAPSImg\ license.txt"
- msys64\usr\bin\bash -lc "cd c:/projects/caprice32 && PATH=$PATH:%MINGW_DIR%/bin /usr/bin/make -j %NUMBER_OF_PROCESSORS% ARCH=%WINARCh% clean"
- msys64\usr\bin\bash -lc "cd c:/projects/caprice32 && PATH=$PATH:%MINGW_DIR%/bin /usr/bin/make -j %NUMBER_OF_PROCESSORS% ARCH=%WINARCH% MINGW_PATH=\"%MINGW_DIR%\" WITH_IPF=true CFLAGS=-Ii686-linux-gnu-capsimage/include"
- msys64\usr\bin\bash -lc "cd c:/projects/caprice32 && PATH=$PATH:%MINGW_DIR%/bin /usr/bin/make -j %NUMBER_OF_PROCESSORS% ARCH=%WINARCH% MINGW_PATH=\"%MINGW_DIR%\" WINE=\"\" WITH_IPF=true CFLAGS=-Ii686-linux-gnu-capsimage/include unit_test"
- msys64\usr\bin\bash -lc "[ \"%RUN_E2E%\" == \"false\" ] || (cd c:/projects/caprice32 && PATH=$PATH:%MINGW_DIR%/bin /usr/bin/make -j %NUMBER_OF_PROCESSORS% ARCH=%WINARCH% MINGW_PATH=\"%MINGW_DIR%\" WINE=\"\" WITH_IPF=true CFLAGS=-Ii686-linux-gnu-capsimage/include e2e_test)"
- msys64\usr\bin\bash -lc "cd c:/projects/caprice32 && PATH=$PATH:%MINGW_DIR%/bin ./test/integrated/test_win_package.sh %WINARCH%"
- msys64\usr\bin\bash -lc "cd c:/projects/caprice32 && PATH=$PATH:%MINGW_DIR%/bin ./test/integrated/test_win_deps.sh %WINARCH%"
# ======
# = 4- Delete and recreate latest tag to trigger the 2nd build that will update the release date (https://github.com/appveyor/ci/issues/827)
# = Only do it for build on master branch to avoid looping !
# ====
- ps: |
if ($env:APPVEYOR_REPO_TAG -eq "false") {
try {
git config --global credential.helper store
Set-Content -Path "$HOME\.git-credentials" -Value "https://$($env:access_token):[email protected]`n" -NoNewline
git config --global user.email "[email protected]"
git config --global user.name "Colin Pitrat (AppVeyor)"
git tag -d latest
git tag latest HEAD
git push -q -f origin latest
if (-not $?) {
throw "git push failed ..."
}
} catch {
Write-Output "Deletion of tag latest failed, ignoring."
}
}
artifacts:
- path: "release\\cap32-%WINARCH%.zip"
name: cap32-%WINARCH%.zip
deploy:
# Ugly hack for https://github.com/appveyor/ci/issues/827
# We build 2 times.
# 1st build: a pre-release on master at each commit, marking the release as prerelease and setting tag 'latest'.
- release: "Caprice32 latest"
tag: latest
description: "Latest build of Caprice 32, with the newest cool features and the most recent bugs."
provider: GitHub
auth_token:
secure: piEKiVbXBFm0fcZCREEII0pxZth77lewlfMc7qApggKVDXswkPaFJKM9eyGAaUy3
artifact: cap32-%WINARCH%.zip
draft: false
prerelease: false
force_update: true
on:
branch: master
# 2nd build: a release from 'latest' tag. The only purpose of this release is to update the release date
#- release: "Caprice32 latest"
# tag: latest
# description: "Latest build of Caprice 32, with the newest cool features and the most recent bugs."
# provider: GitHub
# auth_token:
# secure: piEKiVbXBFm0fcZCREEII0pxZth77lewlfMc7qApggKVDXswkPaFJKM9eyGAaUy3
# artifact: cap32-%WINARCH%.zip
# draft: false
# prerelease: false
# force_update: true
# on:
# branch: latest
# This deployment is for tagged versions (e.g: v4.4.0)
- release: "Caprice32 %APPVEYOR_REPO_TAG_NAME%"
tag: "%APPVEYOR_REPO_TAG_NAME%"
provider: GitHub
auth_token:
secure: piEKiVbXBFm0fcZCREEII0pxZth77lewlfMc7qApggKVDXswkPaFJKM9eyGAaUy3
artifact: cap32-%WINARCH%.zip
draft: false
prerelease: false
force_update: true
on:
appveyor_repo_tag: true