forked from Chocobo1/windows-chewing-tsf-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.appveyor.yml
133 lines (99 loc) · 3.86 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
# Notes:
# - Minimal appveyor.yml file is an empty file. All sections are optional.
# - Indent each level of configuration with 2 spaces. Do not use tabs!
# - All section names are case-sensitive.
# - Section names should be unique on each level.
#---------------------------------#
# general configuration #
#---------------------------------#
# version format
version: '{branch}-{build}'
# manual mode
branches:
except:
- /.*/
# Do not build on tags (GitHub only)
skip_tags: true
#---------------------------------#
# environment configuration #
#---------------------------------#
# environment variables
# build system info: https://www.appveyor.com/docs/build-environment/#pre-installed-software
os: Visual Studio 2017
environment:
PROJECT_DIR: &PROJECT_DIR c:\project
REPO_DIR: c:\project\windows-chewing-tsf # directory created by appveyor
BUILD_DIR: c:\build
INST_DIR: c:\build\installer
NSIS_EXE: c:\Program Files (x86)\NSIS\makensis.exe
SQLITE_DIR: c:\sqlite
SQLITE_URL: https://www.sqlite.org/2017/sqlite-amalgamation-3190200.zip
CMAKE_GEN_X86: Visual Studio 15 2017
CMAKE_GEN_X64: Visual Studio 15 2017 Win64
SOL_FILE: windows-chewing-tsf.sln
MSBUILD_CMD_X86: /maxcpucount /property:Configuration=Release,Platform=Win32 /target:ChewingPreferences,ChewingTextService,all_static_data,data
MSBUILD_CMD_X64: /maxcpucount /property:Configuration=Release,Platform=x64 /target:ChewingTextService
# clone directory
clone_folder: *PROJECT_DIR
# set clone depth
clone_depth: 1
#---------------------------------#
# build configuration #
#---------------------------------#
# scripts to run before build
before_build:
# git submodules
- 'cd "%REPO_DIR%"'
- 'git submodule update --init --remote --depth 1 --recursive'
# updating sqlite-amalgamation
- 'cd \'
- 'appveyor DownloadFile "%SQLITE_URL%" -FileName "sqlite.zip"'
- '7z e "sqlite.zip" -o"%SQLITE_DIR%"'
- 'copy /Y "%SQLITE_DIR%\*" "%REPO_DIR%\libchewing\thirdparty\sqlite-amalgamation"'
# to run your custom scripts instead of automatic MSBuild
build_script:
# build start
- 'mkdir "%BUILD_DIR%"'
# build x86
- 'cd "%BUILD_DIR%" && mkdir "x86" && cd "x86"'
- 'cmake -G "%CMAKE_GEN_X86%" "%REPO_DIR%"'
- 'msbuild %SOL_FILE% %MSBUILD_CMD_X86%'
# build x64
- 'cd "%BUILD_DIR%" && mkdir "x64" && cd "x64"'
- 'cmake -G "%CMAKE_GEN_X64%" "%REPO_DIR%"'
- 'msbuild %SOL_FILE% %MSBUILD_CMD_X64%'
# scripts to run before deployment
after_build:
# prepare for NSIS
- 'mkdir "%INST_DIR%" && cd "%INST_DIR%"'
- 'copy "%REPO_DIR%\installer\*" ".\"'
- 'copy "%REPO_DIR%\COPYING.txt" ".\..\"' # special case for LICENSE file
- 'cd "%INST_DIR%" && mkdir "Dictionary"'
- 'copy "%BUILD_DIR%\x86\libchewing\data\*" ".\Dictionary"'
- 'cd "%INST_DIR%" && mkdir "x86"'
- 'copy "%BUILD_DIR%\x86\ChewingTextService\Release\*.dll" ".\x86"'
- 'copy "%BUILD_DIR%\x86\ChewingPreferences\Release\*.exe" "."'
- 'cd "%INST_DIR%" && mkdir "x64"'
- 'copy "%BUILD_DIR%\x64\ChewingTextService\Release\*.dll" ".\x64"'
# run NSIS
- 'cd "%INST_DIR%"'
- '"%NSIS_EXE%" "installer.nsi"'
# prepare for artifacts packaging
- 'cd "%INST_DIR%"'
- 'copy "windows-chewing-tsf.exe" "%PROJECT_DIR%"' # the artifact must reside at the source repo root
# generate SHA1
- 'cd "%PROJECT_DIR%"'
- 'powershell -Command "& { $hash = (Get-FileHash -Algorithm SHA1 "windows-chewing-tsf.exe").hash.ToString().toLower(); Write-Host $hash " *windows-chewing-tsf.exe"; }" > "windows-chewing-tsf.exe.sha1"'
#---------------------------------#
# tests configuration #
#---------------------------------#
# to disable automatic tests
test: off
#---------------------------------#
# artifacts configuration #
#---------------------------------#
artifacts:
- path: windows-chewing-tsf.exe
name: installer
- path: windows-chewing-tsf.exe.sha1
name: checksum