Skip to content

Commit dc54d50

Browse files
authored
Merge pull request #3 from vcmi/rebuid_package
Workflow improvements
2 parents c295203 + e8fb9c4 commit dc54d50

File tree

2 files changed

+78
-47
lines changed

2 files changed

+78
-47
lines changed

.github/workflows/rebuildDependencies.yml

+75-36
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,40 @@ jobs:
1515
include:
1616
- platform: mac-intel
1717
os: macos-13
18-
preset: macos-conan-ninja-release
18+
before_install: macos.sh
1919
conan_profile: macos-intel
20+
conan_prebuilts: dependencies-mac-intel
2021
conan_options: --options with_apple_system_libs=True
21-
artifact_platform: intel
2222
- platform: mac-arm
2323
os: macos-13
24-
preset: macos-arm-conan-ninja-release
24+
before_install: macos.sh
2525
conan_profile: macos-arm
26+
conan_prebuilts: dependencies-mac-arm
2627
conan_options: --options with_apple_system_libs=True
27-
artifact_platform: arm
2828
- platform: ios
2929
os: macos-13
30-
preset: ios-release-conan-ccache
30+
before_install: macos.sh
3131
conan_profile: ios-arm64
32+
conan_prebuilts: dependencies-ios
3233
conan_options: --options with_apple_system_libs=True
33-
- platform: mingw
34-
os: ubuntu-22.04
35-
preset: windows-mingw-conan-linux
34+
- platform: mingw-x86-64
35+
os: ubuntu-24.04
36+
before_install: mingw.sh
3637
conan_profile: mingw64-linux.jinja
37-
- platform: mingw-32
38-
os: ubuntu-22.04
39-
preset: windows-mingw-conan-linux
38+
conan_prebuilts: dependencies-mingw-x86-64
39+
- platform: mingw-x86
40+
os: ubuntu-24.04
41+
before_install: mingw.sh
4042
conan_profile: mingw32-linux.jinja
41-
- platform: android-32
42-
os: macos-14
43-
preset: android-conan-ninja-release
43+
conan_prebuilts: dependencies-mingw-x86
44+
- platform: android-armeabi-v7a
45+
os: ubuntu-24.04
4446
conan_profile: android-32-ndk
45-
conan_options: --conf tools.android:ndk_path=$ANDROID_NDK_ROOT
46-
artifact_platform: armeabi-v7a
47-
- platform: android-64
48-
os: macos-14
49-
preset: android-conan-ninja-release
47+
conan_prebuilts: dependencies-android-armeabi-v7a
48+
- platform: android-arm64-v8a
49+
os: ubuntu-24.04
5050
conan_profile: android-64-ndk
51-
conan_options: --conf tools.android:ndk_path=$ANDROID_NDK_ROOT
52-
artifact_platform: arm64-v8a
51+
conan_prebuilts: dependencies-android-arm64-v8a
5352
runs-on: ${{ matrix.os }}
5453
defaults:
5554
run:
@@ -62,21 +61,51 @@ jobs:
6261
repository: 'vcmi/vcmi'
6362
ref: 'update_prebuilts'
6463

65-
- name: Install dependencies
66-
run: source '${{github.workspace}}/CI/${{matrix.platform}}/before_install.sh'
67-
env:
68-
VCMI_BUILD_PLATFORM: x64
64+
- uses: actions/setup-java@v4
65+
if: ${{ startsWith(matrix.platform, 'android') }}
66+
with:
67+
distribution: 'temurin'
68+
java-version: '11'
6969

70-
- name: Remove old packages
71-
run: rm -rf ~/.conan/data/ffmpeg ~/.conan/data/yasm ~/.conan/data/pkgconfig ~/.conan/data/xz_utils
70+
- name: Prepare CI
71+
if: "${{ matrix.before_install != '' }}"
72+
run: source '${{github.workspace}}/CI/before_install/${{matrix.before_install}}'
7273

73-
- name: Setup Python
74-
uses: actions/setup-python@v5
75-
with:
76-
python-version: '3.10'
74+
- name: Install Conan Dependencies
75+
if: "${{ matrix.conan_prebuilts != '' }}"
76+
run: source '${{github.workspace}}/CI/install_conan_dependencies.sh' '${{matrix.conan_prebuilts}}'
7777

78-
- name: Setup Conan
79-
run: pip3 install 'conan<2.0'
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+
run: |
86+
mv ~/.conan/data/libiconv ~/
87+
rm -rf ~/.conan/data/*/*/_/_/package
88+
mv ~/libiconv ~/.conan/data
89+
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
93+
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' }}
104+
run: |
105+
rm -rf ~/.conan/data/sqlite3
106+
107+
- name: Install Conan
108+
run: pipx install 'conan<2.0'
80109

81110
- name: Generate conan profile
82111
run: |
@@ -94,9 +123,19 @@ jobs:
94123
- name: Remove builds and source code
95124
run: "conan remove --builds --src --force '*'"
96125

97-
- name: Remove Android SDK
98-
if: ${{ startsWith(matrix.platform, 'android') }}
99-
run: rm -rf ~/.conan/data/android-ndk
126+
- name: Remove build requirements
127+
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
100139
101140
- name: Create dependencies archive
102141
run: "tar --create --xz --file dependencies-${{matrix.platform}}.txz -C ~/.conan data"

README.md

+3-11
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,13 @@ Current flow to update dependencies:
2222
- ffmpeg fails to find its dependencies when building with conan 1 + msvc 2019. Might be fixed in conan 2.
2323
- Qt fails to build due to broken string escaping in a path (conan 1 + msvc 2019)
2424

25-
- Switch Android CI to use Linux runners instead of macOS runners (both for prebuilts and for vcmi itself)
25+
- Rebuild SDL_mixer and try to enable support for opus and flac. Needs investigation as to why libopus / libflac fail to build
2626

27-
- Upgrade ubuntu runner to ubuntu-24.04 and rebuild packages using newer mingw
28-
29-
- Rebuild boost and disable boost_url which we don't use
30-
31-
- Rebuild SDL (including SDL_mixer and SDL_image).
32-
- Consider updating packages.
33-
- Enable support for opus and flac.
34-
- Remove unnecessary image formats such as gif and pcx
35-
- Ensure that vcmi can load ogg/opus and flac as 'sounds' and not only as music
27+
- Consider removing pcx support from SDL_image
3628

3729
- Rebuild ffmpeg with libdav1d and av1 support enabled. Needs investigation as to why dav1d fails to build on mingw and on android.
3830

39-
- Rebuild all binaries in prebuilts package to ensure that everything is configured correctly and to replace any locally-built binaries with binaries from CI
31+
- Find out why libiconv fails to rebuild on Android
4032

4133
- Rebuild entire package from scratch using latest recipes from conan, to test current version of recipes
4234

0 commit comments

Comments
 (0)