2021-07-27 20:26:17 +02:00
|
|
|
name: VCMI
|
2021-07-05 19:04:17 +02:00
|
|
|
|
2021-07-27 20:26:17 +02:00
|
|
|
on:
|
2022-09-19 10:31:48 +02:00
|
|
|
push:
|
|
|
|
branches:
|
2022-12-02 13:16:22 +02:00
|
|
|
- beta
|
2022-12-23 10:10:05 +02:00
|
|
|
- master
|
2024-01-30 20:55:39 +02:00
|
|
|
- develop
|
2022-09-19 10:31:48 +02:00
|
|
|
pull_request:
|
2022-09-20 11:04:15 +02:00
|
|
|
workflow_dispatch:
|
2022-09-20 11:04:00 +02:00
|
|
|
|
2021-07-05 19:04:17 +02:00
|
|
|
env:
|
|
|
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
2022-05-27 09:11:44 +02:00
|
|
|
BUILD_TYPE: Release
|
2021-07-05 19:04:17 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
2023-03-05 22:29:43 +02:00
|
|
|
- platform: linux-qt6
|
2024-05-16 10:14:55 +02:00
|
|
|
os: ubuntu-24.04
|
2024-01-13 13:02:12 +02:00
|
|
|
test: 0
|
2024-09-06 18:54:49 +02:00
|
|
|
before_install: linux_qt6.sh
|
2023-03-01 16:26:59 +02:00
|
|
|
preset: linux-clang-test
|
2021-07-05 19:04:17 +02:00
|
|
|
- platform: linux
|
2024-05-16 10:14:55 +02:00
|
|
|
os: ubuntu-24.04
|
2024-01-08 21:13:23 +02:00
|
|
|
test: 1
|
2024-09-06 18:54:49 +02:00
|
|
|
before_install: linux_qt5.sh
|
2023-03-01 16:26:59 +02:00
|
|
|
preset: linux-gcc-test
|
2023-07-11 14:30:45 +02:00
|
|
|
- platform: linux
|
|
|
|
os: ubuntu-20.04
|
|
|
|
test: 0
|
2024-09-06 18:54:49 +02:00
|
|
|
before_install: linux_qt5.sh
|
2023-07-11 14:30:45 +02:00
|
|
|
preset: linux-gcc-debug
|
2022-08-30 16:29:00 +02:00
|
|
|
- platform: mac-intel
|
2024-04-13 16:54:27 +02:00
|
|
|
os: macos-13
|
2022-03-05 16:04:13 +02:00
|
|
|
test: 0
|
|
|
|
pack: 1
|
2024-10-27 19:45:12 +02:00
|
|
|
upload: 1
|
2023-12-03 21:03:09 +02:00
|
|
|
pack_type: Release
|
2022-03-05 16:04:13 +02:00
|
|
|
extension: dmg
|
2024-09-06 18:54:49 +02:00
|
|
|
before_install: macos.sh
|
2022-08-30 16:29:00 +02:00
|
|
|
preset: macos-conan-ninja-release
|
|
|
|
conan_profile: macos-intel
|
2024-08-29 21:04:41 +02:00
|
|
|
conan_prebuilts: dependencies-mac-intel
|
2023-02-26 14:53:51 +02:00
|
|
|
conan_options: --options with_apple_system_libs=True
|
2022-08-30 16:29:00 +02:00
|
|
|
artifact_platform: intel
|
|
|
|
- platform: mac-arm
|
2024-04-13 16:54:27 +02:00
|
|
|
os: macos-13
|
2022-08-30 16:29:00 +02:00
|
|
|
test: 0
|
|
|
|
pack: 1
|
2024-10-27 19:45:12 +02:00
|
|
|
upload: 1
|
2023-12-03 21:03:09 +02:00
|
|
|
pack_type: Release
|
2022-08-30 16:29:00 +02:00
|
|
|
extension: dmg
|
2024-09-06 18:54:49 +02:00
|
|
|
before_install: macos.sh
|
2022-08-30 16:29:00 +02:00
|
|
|
preset: macos-arm-conan-ninja-release
|
|
|
|
conan_profile: macos-arm
|
2024-08-29 21:04:41 +02:00
|
|
|
conan_prebuilts: dependencies-mac-arm
|
2023-02-26 14:53:51 +02:00
|
|
|
conan_options: --options with_apple_system_libs=True
|
2022-08-30 16:29:00 +02:00
|
|
|
artifact_platform: arm
|
2022-08-11 12:14:02 +02:00
|
|
|
- platform: ios
|
2024-04-13 16:54:27 +02:00
|
|
|
os: macos-13
|
2022-08-11 12:14:02 +02:00
|
|
|
test: 0
|
|
|
|
pack: 1
|
2024-10-27 19:45:12 +02:00
|
|
|
upload: 1
|
2023-12-03 21:03:09 +02:00
|
|
|
pack_type: Release
|
2022-08-11 12:14:02 +02:00
|
|
|
extension: ipa
|
2024-09-06 18:54:49 +02:00
|
|
|
before_install: macos.sh
|
2023-10-02 00:09:25 +02:00
|
|
|
preset: ios-release-conan-ccache
|
2022-10-13 12:09:15 +02:00
|
|
|
conan_profile: ios-arm64
|
2024-08-29 21:04:41 +02:00
|
|
|
conan_prebuilts: dependencies-ios
|
2023-02-26 14:53:51 +02:00
|
|
|
conan_options: --options with_apple_system_libs=True
|
2024-10-27 11:18:21 +02:00
|
|
|
- platform: msvc-x64
|
2021-07-27 20:26:17 +02:00
|
|
|
os: windows-latest
|
|
|
|
test: 0
|
|
|
|
pack: 1
|
2024-10-30 16:39:56 +02:00
|
|
|
upload: 1
|
2023-12-03 21:03:09 +02:00
|
|
|
pack_type: RelWithDebInfo
|
2021-07-27 20:26:17 +02:00
|
|
|
extension: exe
|
2024-09-06 18:54:49 +02:00
|
|
|
before_install: msvc.sh
|
2024-06-12 23:36:21 +02:00
|
|
|
preset: windows-msvc-release
|
2024-10-27 11:18:21 +02:00
|
|
|
- platform: msvc-x86
|
|
|
|
os: windows-latest
|
|
|
|
test: 0
|
|
|
|
pack: 1
|
|
|
|
pack_type: RelWithDebInfo
|
|
|
|
extension: exe
|
|
|
|
before_install: msvc.sh
|
|
|
|
preset: windows-msvc-release-x86
|
2024-09-06 18:57:37 +02:00
|
|
|
- platform: mingw_x86_64
|
2024-08-29 21:03:51 +02:00
|
|
|
os: ubuntu-24.04
|
2023-01-22 23:54:25 +02:00
|
|
|
test: 0
|
|
|
|
pack: 1
|
2023-12-03 21:03:09 +02:00
|
|
|
pack_type: Release
|
2023-01-22 23:54:25 +02:00
|
|
|
extension: exe
|
|
|
|
cmake_args: -G Ninja
|
2024-09-19 19:04:40 +02:00
|
|
|
before_install: mingw.sh
|
2023-01-22 23:54:25 +02:00
|
|
|
preset: windows-mingw-conan-linux
|
2023-01-25 18:44:57 +02:00
|
|
|
conan_profile: mingw64-linux.jinja
|
2024-09-06 18:57:37 +02:00
|
|
|
conan_prebuilts: dependencies-mingw-x86-64
|
|
|
|
- platform: mingw_x86
|
2024-08-29 21:03:51 +02:00
|
|
|
os: ubuntu-24.04
|
2023-12-15 18:35:33 +02:00
|
|
|
test: 0
|
|
|
|
pack: 1
|
|
|
|
pack_type: Release
|
|
|
|
extension: exe
|
|
|
|
cmake_args: -G Ninja
|
2024-09-19 19:04:40 +02:00
|
|
|
before_install: mingw.sh
|
2023-12-15 18:35:33 +02:00
|
|
|
preset: windows-mingw-conan-linux
|
|
|
|
conan_profile: mingw32-linux.jinja
|
2024-09-06 18:57:37 +02:00
|
|
|
conan_prebuilts: dependencies-mingw-x86
|
2023-02-26 14:53:51 +02:00
|
|
|
- platform: android-32
|
2024-09-06 18:57:37 +02:00
|
|
|
os: ubuntu-24.04
|
2024-10-27 19:45:12 +02:00
|
|
|
upload: 1
|
2023-02-26 14:53:51 +02:00
|
|
|
extension: apk
|
2024-06-21 16:43:08 +02:00
|
|
|
preset: android-conan-ninja-release
|
2024-09-06 18:57:37 +02:00
|
|
|
before_install: android.sh
|
|
|
|
conan_profile: android-32-ndk
|
|
|
|
conan_prebuilts: dependencies-android-armeabi-v7a
|
2023-02-26 14:53:51 +02:00
|
|
|
artifact_platform: armeabi-v7a
|
|
|
|
- platform: android-64
|
2024-09-06 18:57:37 +02:00
|
|
|
os: ubuntu-24.04
|
2024-10-27 19:45:12 +02:00
|
|
|
upload: 1
|
2023-02-26 14:53:51 +02:00
|
|
|
extension: apk
|
2024-06-21 16:43:08 +02:00
|
|
|
preset: android-conan-ninja-release
|
2024-09-06 18:57:37 +02:00
|
|
|
before_install: android.sh
|
|
|
|
conan_profile: android-64-ndk
|
|
|
|
conan_prebuilts: dependencies-android-arm64-v8a
|
2023-04-15 10:47:24 +02:00
|
|
|
artifact_platform: arm64-v8a
|
2021-07-05 19:04:17 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
2021-07-27 20:26:17 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
2021-07-05 19:04:17 +02:00
|
|
|
|
|
|
|
steps:
|
2024-08-29 21:04:41 +02:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v4
|
2021-07-05 19:04:17 +02:00
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
2024-08-29 21:04:41 +02:00
|
|
|
- name: Prepare CI
|
2024-09-06 18:54:49 +02:00
|
|
|
if: "${{ matrix.before_install != '' }}"
|
|
|
|
run: source '${{github.workspace}}/CI/before_install/${{matrix.before_install}}'
|
2021-07-05 19:04:17 +02:00
|
|
|
env:
|
2021-07-27 20:26:17 +02:00
|
|
|
VCMI_BUILD_PLATFORM: x64
|
2022-05-26 07:55:20 +02:00
|
|
|
|
2024-08-29 21:04:41 +02:00
|
|
|
- name: Install Conan Dependencies
|
|
|
|
if: "${{ matrix.conan_prebuilts != '' }}"
|
|
|
|
run: source '${{github.workspace}}/CI/install_conan_dependencies.sh' '${{matrix.conan_prebuilts}}'
|
|
|
|
|
2024-10-27 11:18:21 +02:00
|
|
|
- name: Install vcpkg Dependencies
|
|
|
|
if: ${{ startsWith(matrix.platform, 'msvc') }}
|
|
|
|
run: source '${{github.workspace}}/CI/install_vcpkg_dependencies.sh' '${{matrix.platform}}'
|
|
|
|
|
2023-10-29 00:13:36 +02:00
|
|
|
# ensure the ccache for each PR is separate so they don't interfere with each other
|
|
|
|
# fall back to ccache of the vcmi/vcmi repo if no PR-specific ccache is found
|
2024-02-08 20:20:51 +02:00
|
|
|
- name: ccache for PRs
|
2023-09-29 23:55:12 +02:00
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
2023-10-29 00:13:36 +02:00
|
|
|
if: ${{ github.event.number != '' }}
|
2023-09-29 23:55:12 +02:00
|
|
|
with:
|
2023-10-29 00:13:36 +02:00
|
|
|
key: ${{ matrix.preset }}-PR-${{ github.event.number }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ matrix.preset }}-PR-${{ github.event.number }}
|
|
|
|
${{ matrix.preset }}-no-PR
|
|
|
|
# actual cache takes up less space, at most ~1 GB
|
|
|
|
max-size: "5G"
|
|
|
|
verbose: 2
|
|
|
|
|
2024-02-08 20:20:51 +02:00
|
|
|
- name: ccache for everything but PRs
|
2023-10-29 00:13:36 +02:00
|
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
2024-04-26 18:55:14 +02:00
|
|
|
if: ${{ (github.repository == 'vcmi/vcmi' && github.event.number == '' && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/master')) || github.repository != 'vcmi/vcmi' }}
|
2023-10-29 00:13:36 +02:00
|
|
|
with:
|
|
|
|
key: ${{ matrix.preset }}-no-PR
|
|
|
|
restore-keys: |
|
|
|
|
${{ matrix.preset }}-no-PR
|
|
|
|
# actual cache takes up less space, at most ~1 GB
|
|
|
|
max-size: "5G"
|
|
|
|
verbose: 2
|
2023-09-29 23:55:12 +02:00
|
|
|
|
2024-01-15 12:39:08 +02:00
|
|
|
- name: Prepare Heroes 3 data
|
2024-01-08 21:13:23 +02:00
|
|
|
env:
|
|
|
|
HEROES_3_DATA_PASSWORD: ${{ secrets.HEROES_3_DATA_PASSWORD }}
|
2024-01-13 13:50:47 +02:00
|
|
|
if: ${{ env.HEROES_3_DATA_PASSWORD != '' && matrix.test == 1 }}
|
2024-01-08 21:13:23 +02:00
|
|
|
run: |
|
2024-07-22 05:04:07 +02:00
|
|
|
if [[ ${{github.repository_owner}} == vcmi ]]
|
|
|
|
then
|
|
|
|
data_url="https://github.com/vcmi-mods/vcmi-test-data/releases/download/v1.0/h3_assets.zip"
|
|
|
|
else
|
|
|
|
data_url="https://github.com/${{github.repository_owner}}/vcmi-test-data/releases/download/v1.0/h3_assets.zip"
|
|
|
|
fi
|
|
|
|
wget --progress=dot:giga "$data_url" -O h3_assets.zip
|
2024-01-08 21:16:00 +02:00
|
|
|
7za x h3_assets.zip -p$HEROES_3_DATA_PASSWORD
|
2024-01-08 21:13:23 +02:00
|
|
|
mkdir -p ~/.local/share/vcmi/
|
2024-01-08 21:16:00 +02:00
|
|
|
mv h3_assets/* ~/.local/share/vcmi/
|
2024-01-08 21:13:23 +02:00
|
|
|
|
2024-09-09 22:19:18 +02:00
|
|
|
- name: Install Conan
|
2022-11-02 10:07:20 +02:00
|
|
|
if: "${{ matrix.conan_profile != '' }}"
|
2024-09-09 22:19:18 +02:00
|
|
|
run: pipx install 'conan<2.0'
|
2023-10-29 00:13:36 +02:00
|
|
|
|
2024-09-09 22:19:18 +02:00
|
|
|
- name: Install Conan profile
|
2022-08-30 16:29:00 +02:00
|
|
|
if: "${{ matrix.conan_profile != '' }}"
|
|
|
|
run: |
|
|
|
|
conan profile new default --detect
|
|
|
|
conan install . \
|
|
|
|
--install-folder=conan-generated \
|
|
|
|
--no-imports \
|
|
|
|
--build=never \
|
|
|
|
--profile:build=default \
|
2022-10-18 09:07:47 +02:00
|
|
|
--profile:host=CI/conan/${{ matrix.conan_profile }} \
|
2023-02-26 14:53:51 +02:00
|
|
|
${{ matrix.conan_options }}
|
2022-10-15 14:03:27 +02:00
|
|
|
env:
|
|
|
|
GENERATE_ONLY_BUILT_CONFIG: 1
|
2022-08-30 16:29:00 +02:00
|
|
|
|
2024-09-19 19:56:12 +02:00
|
|
|
# Workaround for gradle not discovering SDK that was installed via conan
|
|
|
|
- name: Find Android NDK
|
|
|
|
if: ${{ startsWith(matrix.platform, 'android') }}
|
|
|
|
run: sudo ln -s -T /home/runner/.conan/data/android-ndk/r25c/_/_/package/4db1be536558d833e52e862fd84d64d75c2b3656/bin /usr/local/lib/android/sdk/ndk/25.2.9519653
|
|
|
|
|
|
|
|
- name: Install Java
|
|
|
|
uses: actions/setup-java@v4
|
2024-04-22 09:26:05 +02:00
|
|
|
if: ${{ startsWith(matrix.platform, 'android') }}
|
|
|
|
with:
|
|
|
|
distribution: 'temurin'
|
|
|
|
java-version: '11'
|
|
|
|
|
2024-08-22 22:10:34 +02:00
|
|
|
# a hack to build ID for x64 build in order for Google Play to allow upload of both 32 and 64 bit builds
|
|
|
|
- name: Bump Android x64 build ID
|
|
|
|
if: ${{ matrix.platform == 'android-64' }}
|
|
|
|
run: perl -i -pe 's/versionCode (\d+)/$x=$1+1; "versionCode $x"/e' android/vcmi-app/build.gradle
|
|
|
|
|
2021-07-05 19:04:17 +02:00
|
|
|
- name: Build Number
|
|
|
|
run: |
|
2021-07-27 20:26:17 +02:00
|
|
|
source '${{github.workspace}}/CI/get_package_name.sh'
|
2022-08-30 16:29:00 +02:00
|
|
|
if [ '${{ matrix.artifact_platform }}' ]; then
|
|
|
|
VCMI_PACKAGE_FILE_NAME+="-${{ matrix.artifact_platform }}"
|
|
|
|
fi
|
2021-07-05 19:04:17 +02:00
|
|
|
echo VCMI_PACKAGE_FILE_NAME="$VCMI_PACKAGE_FILE_NAME" >> $GITHUB_ENV
|
|
|
|
echo VCMI_PACKAGE_NAME_SUFFIX="$VCMI_PACKAGE_NAME_SUFFIX" >> $GITHUB_ENV
|
2024-04-25 17:52:25 +02:00
|
|
|
echo VCMI_PACKAGE_GOLDMASTER="$VCMI_PACKAGE_GOLDMASTER" >> $GITHUB_ENV
|
2021-07-05 19:04:17 +02:00
|
|
|
env:
|
|
|
|
PULL_REQUEST: ${{ github.event.pull_request.number }}
|
|
|
|
|
2024-01-04 19:05:34 +02:00
|
|
|
- name: Configure
|
2023-09-29 23:55:12 +02:00
|
|
|
run: |
|
2024-06-12 23:36:21 +02:00
|
|
|
if [[ ${{matrix.preset}} == linux-gcc-test ]]
|
|
|
|
then
|
|
|
|
cmake -DENABLE_CCACHE:BOOL=ON -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14 --preset ${{ matrix.preset }}
|
2024-06-24 15:35:14 +02:00
|
|
|
elif [[ (${{matrix.preset}} == android-conan-ninja-release) && (${{github.ref}} != 'refs/heads/master') ]]
|
|
|
|
then
|
|
|
|
cmake -DENABLE_CCACHE:BOOL=ON -DANDROID_GRADLE_PROPERTIES="applicationIdSuffix=.daily;signingConfig=dailySigning;applicationLabel=VCMI daily" --preset ${{ matrix.preset }}
|
2024-10-27 19:45:12 +02:00
|
|
|
elif [[ ${{startsWith(matrix.platform, 'msvc') }} ]]
|
2024-06-12 23:36:21 +02:00
|
|
|
then
|
|
|
|
cmake --preset ${{ matrix.preset }}
|
2024-10-27 19:45:12 +02:00
|
|
|
else
|
|
|
|
cmake -DENABLE_CCACHE:BOOL=ON --preset ${{ matrix.preset }}
|
2024-06-12 23:36:21 +02:00
|
|
|
fi
|
2023-09-29 23:55:12 +02:00
|
|
|
|
2024-01-04 19:05:34 +02:00
|
|
|
- name: Build
|
2021-07-27 20:26:17 +02:00
|
|
|
run: |
|
2022-05-26 07:55:20 +02:00
|
|
|
cmake --build --preset ${{matrix.preset}}
|
2024-06-21 16:43:08 +02:00
|
|
|
env:
|
|
|
|
ANDROID_STORE_PASSWORD: ${{ secrets.ANDROID_STORE_PASSWORD }}
|
|
|
|
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
2021-07-05 19:04:17 +02:00
|
|
|
|
|
|
|
- name: Test
|
2024-01-13 13:50:47 +02:00
|
|
|
env:
|
|
|
|
HEROES_3_DATA_PASSWORD: ${{ secrets.HEROES_3_DATA_PASSWORD }}
|
|
|
|
if: ${{ env.HEROES_3_DATA_PASSWORD != '' && matrix.test == 1 }}
|
2021-07-05 19:04:17 +02:00
|
|
|
run: |
|
2022-05-26 07:55:20 +02:00
|
|
|
ctest --preset ${{matrix.preset}}
|
|
|
|
|
2024-04-22 09:26:05 +02:00
|
|
|
- name: Kill XProtect to work around CPack issue on macOS
|
2024-01-23 12:42:24 +02:00
|
|
|
if: ${{ startsWith(matrix.platform, 'mac') }}
|
2024-01-23 01:25:23 +02:00
|
|
|
run: |
|
|
|
|
# Cf. https://github.com/actions/runner-images/issues/7522#issuecomment-1556766641
|
|
|
|
echo Killing...; sudo pkill -9 XProtect >/dev/null || true;
|
2024-01-23 12:42:24 +02:00
|
|
|
echo "Waiting..."; counter=0; while pgrep XProtect && ((counter < 20)); do sleep 3; ((counter++)); done
|
|
|
|
pgrep XProtect || true
|
2024-01-23 01:25:23 +02:00
|
|
|
|
2021-07-12 21:00:29 +02:00
|
|
|
- name: Pack
|
2021-07-05 19:04:17 +02:00
|
|
|
id: cpack
|
2021-07-12 21:00:29 +02:00
|
|
|
if: ${{ matrix.pack == 1 }}
|
2021-07-05 19:04:17 +02:00
|
|
|
run: |
|
2022-05-26 07:55:20 +02:00
|
|
|
cd '${{github.workspace}}/out/build/${{matrix.preset}}'
|
2024-09-09 22:32:44 +02:00
|
|
|
|
2024-09-06 18:59:31 +02:00
|
|
|
# Workaround for CPack bug on macOS 13
|
|
|
|
counter=0
|
2024-10-14 15:23:48 +02:00
|
|
|
until cpack -C ${{matrix.pack_type}} || ((counter > 20)); do
|
|
|
|
sleep 3
|
2024-09-06 18:59:31 +02:00
|
|
|
((counter++))
|
|
|
|
done
|
2024-10-27 12:23:47 +02:00
|
|
|
rm -rf _CPack_Packages
|
2022-05-26 07:55:20 +02:00
|
|
|
|
2021-07-12 21:00:29 +02:00
|
|
|
- name: Artifacts
|
|
|
|
if: ${{ matrix.pack == 1 }}
|
2024-01-14 15:11:15 +02:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-07-12 21:00:29 +02:00
|
|
|
with:
|
|
|
|
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }}
|
2024-10-27 11:18:21 +02:00
|
|
|
compression-level: 0
|
2022-05-26 07:55:20 +02:00
|
|
|
path: |
|
2023-02-16 14:38:13 +02:00
|
|
|
${{github.workspace}}/out/build/${{matrix.preset}}/${{ env.VCMI_PACKAGE_FILE_NAME }}.${{ matrix.extension }}
|
2024-04-22 09:26:05 +02:00
|
|
|
|
|
|
|
- name: Find Android package
|
|
|
|
if: ${{ startsWith(matrix.platform, 'android') }}
|
|
|
|
run: |
|
|
|
|
builtApkPath="$(ls ${{ github.workspace }}/out/build/${{ matrix.preset }}/android-build/vcmi-app/build/outputs/apk/release/*.${{ matrix.extension }})"
|
2024-06-26 12:58:28 +02:00
|
|
|
builtAabPath="$(ls ${{ github.workspace }}/out/build/${{ matrix.preset }}/android-build/vcmi-app/build/outputs/bundle/release/*.aab)"
|
2024-04-22 09:26:05 +02:00
|
|
|
ANDROID_APK_PATH="${{ github.workspace }}/$VCMI_PACKAGE_FILE_NAME.${{ matrix.extension }}"
|
2024-06-24 15:38:49 +02:00
|
|
|
ANDROID_AAB_PATH="${{ github.workspace }}/$VCMI_PACKAGE_FILE_NAME.aab"
|
2024-04-22 09:26:05 +02:00
|
|
|
mv "$builtApkPath" "$ANDROID_APK_PATH"
|
2024-06-24 15:38:49 +02:00
|
|
|
mv "$builtAabPath" "$ANDROID_AAB_PATH"
|
2024-04-22 09:26:05 +02:00
|
|
|
echo "ANDROID_APK_PATH=$ANDROID_APK_PATH" >> $GITHUB_ENV
|
2024-06-24 15:38:49 +02:00
|
|
|
echo "ANDROID_AAB_PATH=$ANDROID_AAB_PATH" >> $GITHUB_ENV
|
|
|
|
|
2024-09-09 22:32:44 +02:00
|
|
|
- name: Upload android apk artifacts
|
|
|
|
if: ${{ startsWith(matrix.platform, 'android') }}
|
2024-01-14 15:11:15 +02:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-02-26 14:53:51 +02:00
|
|
|
with:
|
|
|
|
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }}
|
2024-10-27 11:18:21 +02:00
|
|
|
compression-level: 0
|
2023-02-26 14:53:51 +02:00
|
|
|
path: |
|
|
|
|
${{ env.ANDROID_APK_PATH }}
|
2024-04-22 09:26:05 +02:00
|
|
|
|
2024-09-09 22:32:44 +02:00
|
|
|
- name: Upload Android aab artifacts
|
2024-08-29 21:04:58 +02:00
|
|
|
if: ${{ startsWith(matrix.platform, 'android') && github.ref == 'refs/heads/master' }}
|
2024-06-24 15:38:49 +02:00
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }} - aab
|
2024-10-27 11:18:21 +02:00
|
|
|
compression-level: 0
|
2024-06-24 15:38:49 +02:00
|
|
|
path: |
|
|
|
|
${{ env.ANDROID_AAB_PATH }}
|
|
|
|
|
2024-09-09 22:32:44 +02:00
|
|
|
- name: Upload debug symbols
|
2024-10-27 11:18:21 +02:00
|
|
|
if: ${{ startsWith(matrix.platform, 'msvc') }}
|
2024-01-14 15:11:15 +02:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-12-03 20:20:59 +02:00
|
|
|
with:
|
|
|
|
name: ${{ env.VCMI_PACKAGE_FILE_NAME }} - ${{ matrix.platform }} - symbols
|
2024-10-27 11:18:21 +02:00
|
|
|
compression-level: 9
|
2023-12-03 20:20:59 +02:00
|
|
|
path: |
|
|
|
|
${{github.workspace}}/**/*.pdb
|
2022-05-26 07:55:20 +02:00
|
|
|
|
2021-07-12 21:00:29 +02:00
|
|
|
- name: Upload build
|
2024-10-30 16:39:56 +02:00
|
|
|
if: ${{ (matrix.upload == 1) && (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/master') }}
|
2023-02-27 09:01:09 +02:00
|
|
|
continue-on-error: true
|
2021-07-12 21:00:29 +02:00
|
|
|
run: |
|
2024-04-22 09:26:05 +02:00
|
|
|
if [ -z '${{ env.ANDROID_APK_PATH }}' ] ; then
|
2023-03-06 20:29:46 +02:00
|
|
|
cd '${{github.workspace}}/out/build/${{matrix.preset}}'
|
|
|
|
fi
|
2021-07-27 20:26:17 +02:00
|
|
|
source '${{github.workspace}}/CI/upload_package.sh'
|
2021-07-12 21:00:29 +02:00
|
|
|
env:
|
|
|
|
DEPLOY_RSA: ${{ secrets.DEPLOY_RSA }}
|
|
|
|
PACKAGE_EXTENSION: ${{ matrix.extension }}
|
2024-04-22 09:26:05 +02:00
|
|
|
|
2024-05-11 04:49:40 +02:00
|
|
|
deploy-src:
|
2024-05-11 11:12:22 +02:00
|
|
|
if: always() && github.ref == 'refs/heads/master'
|
2024-06-20 15:12:58 +02:00
|
|
|
runs-on: ubuntu-latest
|
2024-05-11 04:49:40 +02:00
|
|
|
defaults:
|
|
|
|
run:
|
2024-05-11 11:12:22 +02:00
|
|
|
shell: bash
|
2024-05-11 04:49:40 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
2024-05-11 11:12:22 +02:00
|
|
|
|
|
|
|
- name: Build Number
|
|
|
|
run: |
|
|
|
|
source '${{github.workspace}}/CI/get_package_name.sh'
|
|
|
|
echo VCMI_PACKAGE_FILE_NAME="$VCMI_PACKAGE_FILE_NAME" >> $GITHUB_ENV
|
2024-05-11 04:49:40 +02:00
|
|
|
|
|
|
|
- name: Create source code archive (including submodules)
|
|
|
|
run: |
|
2024-05-11 11:12:22 +02:00
|
|
|
git archive HEAD -o "release.tar" --worktree-attributes -v
|
2024-05-11 04:49:40 +02:00
|
|
|
git submodule update --init --recursive
|
2024-05-11 11:12:22 +02:00
|
|
|
git submodule --quiet foreach 'cd "$toplevel"; tar -rvf "release.tar" "$sm_path"'
|
|
|
|
gzip release.tar
|
2024-05-11 04:49:40 +02:00
|
|
|
|
|
|
|
- name: Upload source code archive
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
2024-05-11 11:12:22 +02:00
|
|
|
name: ${{ env.VCMI_PACKAGE_FILE_NAME }}
|
2024-05-11 04:49:40 +02:00
|
|
|
path: |
|
2024-05-11 11:12:22 +02:00
|
|
|
./release.tar.gz
|
2024-06-24 15:27:08 +02:00
|
|
|
|
|
|
|
validate-code:
|
|
|
|
if: always()
|
|
|
|
runs-on: ubuntu-24.04
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Ensure LF line endings
|
|
|
|
run: |
|
|
|
|
find . -path ./.git -prune -o -path ./AI/FuzzyLite -prune -o -path ./test/googletest \
|
|
|
|
-o -path ./osx -prune -o -type f \
|
2024-09-24 15:30:54 +02:00
|
|
|
-not -name '*.png' -and -not -name '*.ttf' -and -not -name '*.wav' -and -not -name '*.webm' -and -not -name '*.ico' -and -not -name '*.bat' -print0 | \
|
2024-06-24 15:27:08 +02:00
|
|
|
{ ! xargs -0 grep -l -z -P '\r\n'; }
|
|
|
|
|
|
|
|
- name: Validate JSON
|
|
|
|
run: |
|
|
|
|
sudo apt install python3-jstyleson
|
2024-09-06 18:59:54 +02:00
|
|
|
python3 CI/validate_json.py
|
2024-11-30 22:20:15 +02:00
|
|
|
|
|
|
|
- name: Validate Markdown
|
|
|
|
uses: DavidAnson/markdownlint-cli2-action@v18
|
|
|
|
with:
|
|
|
|
config: 'CI/example.markdownlint-cli2.jsonc'
|
|
|
|
globs: '**/*.md'
|