Skip to content

conan v2 wip

conan v2 wip #67

name: VCMI - dependencies
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- platform: mac-intel
os: macos-14
before_install: macos.sh
conan_profile: macos-intel
conan_system_libs: bzip2 libiconv sqlite3 zlib
- platform: mac-arm
os: macos-14
before_install: macos.sh
conan_profile: macos-arm
conan_system_libs: bzip2 libiconv sqlite3 zlib
- platform: ios
os: macos-14
before_install: macos.sh
conan_profile: ios-arm64
conan_system_libs: bzip2 libiconv sqlite3 zlib
- platform: android-armeabi-v7a
os: ubuntu-24.04
before_install: android.sh
conan_profile: android-32-ndk
conan_system_libs: zlib
- platform: android-arm64-v8a
os: ubuntu-24.04
conan_profile: android-64-ndk
conan_system_libs: zlib
- platform: windows-x64
os: windows-2022
# before_install: msvc.sh
conan_profile: msvc-x64
conan_options: -o target_pre_windows10=True
runs-on: ${{ matrix.os }}
steps:
- name: Checkout VCMI
uses: actions/checkout@v4
# TODO
with:
repository: 'kambala-decapitator/vcmi'
ref: 'conan-v2'
- uses: actions/setup-java@v4
if: ${{ startsWith(matrix.platform, 'android') }}
with:
distribution: 'temurin'
java-version: '17'
- name: Prepare CI
if: ${{ matrix.before_install }}
shell: bash
run: source '${{github.workspace}}/CI/before_install/${{matrix.before_install}}'
- name: Install Conan
run: |
pipx install conan
conan profile detect
- name: Install system libs recipes
if: ${{ matrix.conan_system_libs }}
shell: bash
run: |
systemLibsRepo='conan-system-libs'
git clone "https://github.com/kambala-decapitator/$systemLibsRepo.git" \
--depth 1 \
--no-tags \
--single-branch
cd "$systemLibsRepo"
for p in ${{ matrix.conan_system_libs }} ; do
conan create "$p" --user system
done
- name: Checkout current
uses: actions/checkout@v4
with:
path: deps
- name: Build recipes with our patches
shell: bash
run: |
set -x
cciRepo='conan-center-index'
branchName='master'
recipePathMinizip='recipes/minizip'
recipePathQt='recipes/qt'
custom_patches_path="$(pwd)/deps/conan_patches"
git clone "https://github.com/conan-io/$cciRepo.git" \
--branch "$branchName" \
--no-checkout \
--depth 1 \
--no-tags \
--single-branch
cd "$cciRepo"
git sparse-checkout init
git sparse-checkout set "$recipePathMinizip" "$recipePathQt"
git switch "$branchName"
# versions must be synced with: conan_patches/<package>/conandata.yml
# if no custom patches are required for a package, it should be removed from here
for p in minizip/1.3.1 qt/5.15.16 ; do
IFS_OLD="$IFS"
IFS=/
read package version <<<"$p"
IFS="IFS_OLD"
if [[ $package == qt ]] ; then
packagePath="$recipePathQt/5.x.x"
else
packagePath="recipes/$package/all"
fi
conan create "$packagePath" \
--version="$version" \
--profile=CI/conan/${{ matrix.conan_profile }} \
--build=missing \
--test-folder='' \
--core-conf core.sources.patch:extra_path="$custom_patches_path"
done
# TODO: remove when https://github.com/conan-io/conan-center-index/pull/26577 is merged
- name: Build LuaJIT from PR changes
shell: bash
run: |
cciForkRepo='cci-fork'
branchName='package/luajit'
recipePath='recipes/luajit'
git clone "https://github.com/kambala-decapitator/conan-center-index.git" "$cciForkRepo" \
--branch "$branchName" \
--no-checkout \
--depth 1 \
--no-tags \
--single-branch
cd "$cciForkRepo"
git sparse-checkout init
git sparse-checkout set "$recipePath"
git switch "$branchName"
conan create "$recipePath/all" \
--version=2.1.0-beta3 \
--profile=CI/conan/${{ matrix.conan_profile }} \
--build=missing \
--test-folder=''
# must run in the native platform shell: Qt doesn't build in bash on Windows
- name: Generate conan profile
run: |
conan install . -of conan-generated -b missing -pr CI/conan/${{ matrix.conan_profile }} ${{ matrix.conan_options }}
- name: Remove builds and source code
run: conan cache clean
- name: Remove build requirements' binaries
shell: bash
run: |
buildPackages=$(conan graph info . \
--profile=CI/conan/${{ matrix.conan_profile }} \
--format=json \
--build=never \
--no-remote \
--filter=context \
| jq -rb '.graph.nodes[] | select(.context == "build") | .ref' \
| sort | uniq \
)
for p in $buildPackages ; do
conan remove --confirm "$p:*"
done
- name: Create dependencies archive
run: conan cache save --file dependencies-${{matrix.platform}}.tgz "*:*"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dependencies-${{ matrix.platform }}
compression-level: 0
path: 'dependencies-${{matrix.platform}}.tgz'