1
1
name : VCMI - dependencies
2
2
3
3
on :
4
- push :
5
- branches :
6
- - main
7
4
pull_request :
5
+ paths-ignore :
6
+ - README.md
8
7
workflow_dispatch :
9
8
10
9
jobs :
@@ -14,135 +13,244 @@ jobs:
14
13
matrix :
15
14
include :
16
15
- platform : mac-intel
17
- os : macos-13
16
+ os : macos-14
18
17
before_install : macos.sh
19
18
conan_profile : macos-intel
20
- conan_prebuilts : dependencies-mac-intel
21
- conan_options : --options with_apple_system_libs=True
19
+ conan_system_libs : bzip2 libiconv sqlite3 zlib
22
20
- platform : mac-arm
23
- os : macos-13
21
+ os : macos-14
24
22
before_install : macos.sh
25
23
conan_profile : macos-arm
26
- conan_prebuilts : dependencies-mac-arm
27
- conan_options : --options with_apple_system_libs=True
24
+ conan_system_libs : bzip2 libiconv sqlite3 zlib
28
25
- platform : ios
29
- os : macos-13
26
+ os : macos-14
30
27
before_install : macos.sh
31
28
conan_profile : ios-arm64
32
- conan_prebuilts : dependencies-ios
33
- conan_options : --options with_apple_system_libs=True
34
- - platform : mingw-x86-64
35
- os : ubuntu-24.04
36
- before_install : mingw.sh
37
- conan_profile : mingw64-linux.jinja
38
- conan_prebuilts : dependencies-mingw-x86-64
39
- - platform : mingw-x86
40
- os : ubuntu-24.04
41
- before_install : mingw.sh
42
- conan_profile : mingw32-linux.jinja
43
- conan_prebuilts : dependencies-mingw-x86
29
+ conan_system_libs : bzip2 libiconv sqlite3 zlib
44
30
- platform : android-armeabi-v7a
45
- os : ubuntu-24.04
31
+ os : ubuntu-latest
32
+ before_install : android-32.sh
46
33
conan_profile : android-32-ndk
47
- conan_prebuilts : dependencies-android-armeabi-v7a
34
+ conan_system_libs : zlib
48
35
- platform : android-arm64-v8a
49
- os : ubuntu-24.04
36
+ os : ubuntu-latest
50
37
conan_profile : android-64-ndk
51
- conan_prebuilts : dependencies-android-arm64-v8a
38
+ conan_system_libs : zlib
39
+ - platform : android-x64
40
+ os : ubuntu-latest
41
+ conan_profile : android-x64-ndk
42
+ conan_system_libs : zlib
43
+ - platform : windows-x64
44
+ os : windows-latest
45
+ conan_profile : msvc-x64
46
+ conan_options : -o "&:target_pre_windows10=True"
47
+ - platform : windows-x86
48
+ os : windows-latest
49
+ conan_profile : msvc-x86
50
+ conan_options : -o "&:target_pre_windows10=True"
51
+ - platform : windows-arm64
52
+ os : windows-11-arm
53
+ conan_profile : msvc-arm64
54
+ conan_options : -o "&:lua_lib=lua"
52
55
runs-on : ${{ matrix.os }}
53
56
defaults :
54
57
run :
55
58
shell : bash
56
-
57
59
steps :
58
- - name : Checkout repository
60
+ - name : Checkout current
59
61
uses : actions/checkout@v4
60
- with :
61
- repository : ' vcmi/vcmi'
62
- ref : ' update_prebuilts'
62
+
63
+ - name : Define common variables
64
+ run : |
65
+ echo CUSTOM_PATCHES_PATH="$(pwd)/conan_patches" >> "$GITHUB_ENV"
66
+ echo DEPS_FILE="dependencies-${{ matrix.platform }}.tgz" >> "$GITHUB_ENV"
67
+ echo DEPS_LIST_FILE="dependencies-${{ matrix.platform }}.txt" >> "$GITHUB_ENV"
68
+
69
+ - name : Prepare CI
70
+ if : ${{ matrix.before_install }}
71
+ run : ci/${{ matrix.before_install }}
72
+
73
+ - name : Obtain path to the Windows-aware Perl
74
+ if : ${{ startsWith(matrix.platform, 'windows') }}
75
+ run : |
76
+ windowsPerl=$(which -a perl | fgrep Strawberry)
77
+ echo "WINDOWS_PERL_DIR=$(dirname "$windowsPerl")" >> "$GITHUB_ENV"
63
78
64
79
- uses : actions/setup-java@v4
65
80
if : ${{ startsWith(matrix.platform, 'android') }}
66
81
with :
67
82
distribution : ' temurin'
68
- java-version : ' 11 '
83
+ java-version : ' 17 '
69
84
70
- - name : Prepare CI
71
- if : " ${{ matrix.before_install != '' }}"
72
- run : source '${{github.workspace}}/CI/before_install/${{matrix.before_install}}'
73
-
74
- - name : Install Conan Dependencies
75
- if : " ${{ matrix.conan_prebuilts != '' }}"
76
- run : source '${{github.workspace}}/CI/install_conan_dependencies.sh' '${{matrix.conan_prebuilts}}'
77
-
78
- - name : Remove old binary packages (non-android)
79
- if : ${{ !startsWith(matrix.platform, 'android') }}
80
- run : rm -rf ~/.conan/data/*/*/_/_/package
81
-
82
- # TODO: fix libiconv - fails to build on android (both macos and linux host)
83
- - name : Remove old binary packages (android)
84
- if : ${{ startsWith(matrix.platform, 'android') }}
85
+ - name : Setup Conan Client
86
+ run : |
87
+ pipx install conan
88
+ conan profile detect
89
+
90
+ # CMake/Ninja version should be synced with runners
91
+ # https://github.com/actions/runner-images/tree/main/images
92
+ - name : Prepare platform tools
93
+ run : |
94
+ echo "
95
+ [platform_tool_requires]
96
+ cmake/3.31.6
97
+ ninja/1.13.1
98
+
99
+ [conf]
100
+ tools.cmake.cmaketoolchain:generator=Ninja" >> $(conan profile path default)
101
+
102
+ - name : Install system libs recipes
103
+ if : ${{ matrix.conan_system_libs }}
85
104
run : |
86
- mv ~/.conan/data/libiconv ~/
87
- rm -rf ~/.conan/data/*/*/_/_/package
88
- mv ~/libiconv ~/.conan/data
105
+ systemLibsRepo='conan-system-libs'
106
+ git clone "https://github.com/kambala-decapitator/$systemLibsRepo.git" \
107
+ --depth 1 \
108
+ --no-tags \
109
+ --single-branch
110
+ cd "$systemLibsRepo"
111
+ for p in ${{ matrix.conan_system_libs }} ; do
112
+ conan create "$p" --user system
113
+ done
89
114
90
- # Completely remove packages that were confirmed to be rebuildable using upstream recipe/sources
91
- # TODO: generate entire package from scratch instead of such cleanup
92
- - name : Remove old recipes
115
+ - name : Build recipes with our patches
93
116
run : |
94
- rm -rf ~/.conan/data/boost
95
- rm -rf ~/.conan/data/ffmpeg
96
- rm -rf ~/.conan/data/xz_utils
97
- rm -rf ~/.conan/data/sdl_mixer
98
- rm -rf ~/.conan/data/sdl_image
99
- rm -rf ~/.conan/data/sdl_ttf
100
- rm -rf ~/.conan/data/sdl
101
-
102
- - name : Remove old recipes (non-apple)
103
- if : ${{ matrix.platform != 'ios' && matrix.platform != 'mac-intel' && matrix.platform != 'mac-arm' }}
117
+ cciRepo='conan-center-index'
118
+ branchName='master'
119
+ recipePathQt='recipes/qt'
120
+
121
+ git clone "https://github.com/conan-io/$cciRepo.git" \
122
+ --branch "$branchName" \
123
+ --no-checkout \
124
+ --depth 1 \
125
+ --no-tags \
126
+ --single-branch \
127
+ --sparse
128
+ cd "$cciRepo"
129
+ git sparse-checkout set \
130
+ recipes/minizip \
131
+ recipes/flac \
132
+ $recipePathQt \
133
+
134
+ git checkout
135
+
136
+ # versions must be synced with: conan_patches/<package>/conandata.yml
137
+ # if no custom patches are required for a package, it should be removed from here
138
+ for p in minizip/1.3.1 flac/1.4.2 qt/5.15.16 ; do
139
+ IFS_OLD="$IFS"
140
+ IFS=/
141
+ read package version <<<"$p"
142
+ IFS="$IFS_OLD"
143
+
144
+ if [[ $package == qt ]] ; then
145
+ packagePath="$recipePathQt/5.x.x"
146
+ else
147
+ packagePath="recipes/$package/all"
148
+ fi
149
+
150
+ # Windows workaround for https://bugreports.qt.io/browse/QTBUG-84543
151
+ PATH="$WINDOWS_PERL_DIR:$PATH" conan create $packagePath \
152
+ --version=$version \
153
+ --profile=../conan_profiles/${{ matrix.conan_profile }} \
154
+ --build=missing \
155
+ --test-folder= \
156
+ --core-conf core.sources.patch:extra_path=$CUSTOM_PATCHES_PATH \
157
+ ${{ startsWith(matrix.platform, 'android') && '-o "qt/*:android_sdk=$ANDROID_HOME"' || '' }}
158
+ done
159
+
160
+ # TODO: remove LuaJIT when https://github.com/conan-io/conan-center-index/pull/26577 is merged
161
+ - name : Build LuaJIT from PR changes
162
+ if : ${{ !contains(matrix.conan_options, '"&:lua_lib=lua"') }}
104
163
run : |
105
- rm -rf ~/.conan/data/sqlite3
164
+ cciForkRepo='cci-fork'
165
+ branchName='vcmi'
166
+
167
+ git clone "https://github.com/kambala-decapitator/conan-center-index.git" "$cciForkRepo" \
168
+ --branch "$branchName" \
169
+ --no-checkout \
170
+ --depth 1 \
171
+ --no-tags \
172
+ --single-branch \
173
+ --sparse
174
+ cd "$cciForkRepo"
175
+ git sparse-checkout set \
176
+ recipes/luajit \
106
177
107
- - name : Install Conan
108
- run : pipx install 'conan<2.0'
178
+ git checkout
179
+
180
+ for p in luajit/2.1.0-beta3 ; do
181
+ IFS_OLD="$IFS"
182
+ IFS=/
183
+ read package version <<<"$p"
184
+ IFS="$IFS_OLD"
185
+
186
+ conan create "recipes/$package/all" \
187
+ --version=$version \
188
+ --profile=../conan_profiles/${{ matrix.conan_profile }} \
189
+ --build=missing \
190
+ --test-folder=
191
+ done
109
192
110
193
- name : Generate conan profile
111
194
run : |
112
- conan profile new default --detect
113
195
conan install . \
114
- --install-folder=conan-generated \
115
- --no-imports \
196
+ --output-folder=conan-generated \
116
197
--build=missing \
117
- --profile:build=default \
118
- --profile:host=CI/conan/${{ matrix.conan_profile }} \
198
+ --profile=conan_profiles/${{ matrix.conan_profile }} \
119
199
${{ matrix.conan_options }}
120
- env :
121
- GENERATE_ONLY_BUILT_CONFIG : 1
122
200
123
201
- name : Remove builds and source code
124
- run : " conan remove --builds --src --force '*'"
125
-
126
- - name : Remove build requirements
202
+ run : conan cache clean
203
+
204
+ - name : Get NDK path
205
+ if : ${{ startsWith(matrix.platform, 'android') }}
127
206
run : |
128
- rm -rf ~/.conan/data/android-ndk
129
- rm -rf ~/.conan/data/autoconf
130
- rm -rf ~/.conan/data/automake
131
- rm -rf ~/.conan/data/b2
132
- rm -rf ~/.conan/data/cmake
133
- rm -rf ~/.conan/data/gnu-config
134
- rm -rf ~/.conan/data/libtool
135
- rm -rf ~/.conan/data/m4
136
- rm -rf ~/.conan/data/nasm
137
- rm -rf ~/.conan/data/pkgconf
138
- rm -rf ~/.conan/data/yasm
207
+ ndkPackage='android-ndk'
208
+ hexRegex='[[:xdigit:]]+'
209
+
210
+ ndkPackageRevision=$(conan list --format=compact "$ndkPackage/*:*" \
211
+ | egrep --only-matching "$ndkPackage/\\w+#$hexRegex:$hexRegex")
212
+ ndkPackagePath=$(conan cache path "$ndkPackageRevision")
213
+ ndkPath="$ndkPackagePath/bin"
214
+ echo "NDK directory: $ndkPath"
215
+
216
+ - name : Remove build requirements' binaries
217
+ run : |
218
+ graphFile='graph.json'
219
+ packageListFile='pkglist.json'
220
+
221
+ conan graph info . \
222
+ --profile=conan_profiles/${{ matrix.conan_profile }} \
223
+ ${{ matrix.conan_options }} \
224
+ --format=json \
225
+ --build=never \
226
+ --no-remote \
227
+ > "$graphFile"
228
+ conan list \
229
+ --graph "$graphFile" \
230
+ --graph-context=build-only \
231
+ --format=json \
232
+ > "$packageListFile"
233
+ conan remove --list "$packageListFile" --confirm
234
+
235
+ - name : Create list of built packages
236
+ run : |
237
+ packageList="$(conan list --format=compact | tail -n +2)"
238
+ echo "$packageList" > "$DEPS_LIST_FILE"
239
+ echo "CONAN_PACKAGES<<EOF
240
+ $packageList
241
+ EOF" >> "$GITHUB_ENV"
139
242
140
243
- name : Create dependencies archive
141
- run : " tar --create --xz --file dependencies-${{matrix.platform}}.txz -C ~/.conan data "
244
+ run : conan cache save --file "$DEPS_FILE" "*:* "
142
245
143
- - name : Upload artifacts
246
+ - name : Upload binaries list
247
+ uses : actions/upload-artifact@v4
248
+ with :
249
+ name : list of dependencies-${{ matrix.platform }}
250
+ path : ${{ env.DEPS_LIST_FILE }}
251
+ - name : Upload binaries
144
252
uses : actions/upload-artifact@v4
145
253
with :
146
254
name : dependencies-${{ matrix.platform }}
147
255
compression-level : 0
148
- path : ' dependencies- ${{matrix.platform}}.txz '
256
+ path : ${{ env.DEPS_FILE }}
0 commit comments