Android: adapt CI to bundle the assets

This commit is contained in:
Michał Janiszewski committed 2026-03-22 17:44:47 +01:00
1 parent 430bb2e65d
commit 9b460d2f75
4 files changed
+129 -9

No files matched your search

+19 -9
View File
@@ -176,10 +176,7 @@ jobs:
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- name: Build graphics .dat files
run: |
gxc build g2.dat OpenRCT2/resources/g2/sprites.json
gxc build palettes.dat OpenRCT2/resources/palettes/sprites.json
gxc build fonts.dat OpenRCT2/resources/fonts/sprites.json
gxc build tracks.dat OpenRCT2/resources/tracks/sprites.json
OpenRCT2/scripts/build-graphics-dat "$PWD"
- name: Upload graphics .dat files
uses: actions/upload-artifact@v6
with:
@@ -648,14 +645,18 @@ jobs:
# The gradle cache is by default ~/.gradle/caches, but ~ gets resolved by GitHub Actions to the runner's
# home directory (/home/github), not the user inside the container (/root). Name the path explicitly.
path: /root/.gradle/caches
key: gradle-${{ hashFiles('src/openrct2-android/gradle.properties') }}
# The cache key needs to occasionally be updated as the cache itself is immutable, otherwise it can grow stale. The easiest way to force this is to include the tag, which changes every month.
# Keep in sync with the cache key used in the `android` job.
key: gradle-${{ runner.os }}-${{ needs.build_variables.outputs.tag }}-android-${{ hashFiles('src/openrct2-android/build.gradle', 'src/openrct2-android/settings.gradle', 'src/openrct2-android/app/build.gradle', 'src/openrct2-android/gradle.properties', 'src/openrct2-android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}-${{ needs.build_variables.outputs.tag }}-android-
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build Native Libs
run: |
. scripts/setenv
pushd src/openrct2-android
./gradlew app:externalNativeBuildRelease -PabiFilter=${{ matrix.arch }}
./gradlew app:externalNativeBuildRelease -PabiFilter=${{ matrix.arch }} -PskipAssets -PskipJava
popd
- name: Upload Native Libs
uses: actions/upload-artifact@v6
@@ -667,8 +668,8 @@ jobs:
android:
name: Android
runs-on: ubuntu-latest
needs: [android-libs, build_variables]
container: openrct2/openrct2-build:25-android
needs: [android-libs, build_variables, g2dat]
container: ghcr.io/openrct2/openrct2-build:26-android
steps:
- name: Checkout
uses: actions/checkout@v6
@@ -678,7 +679,10 @@ jobs:
# The gradle cache is by default ~/.gradle/caches, but ~ gets resolved by GitHub Actions to the runner's
# home directory (/home/github), not the user inside the container (/root). Name the path explicitly.
path: /root/.gradle/caches
key: gradle-${{ hashFiles('src/openrct2-android/gradle.properties') }}
# Keep in sync with the cache key used in the `android-libs` job.
key: gradle-${{ runner.os }}-${{ needs.build_variables.outputs.tag }}-android-${{ hashFiles('src/openrct2-android/build.gradle', 'src/openrct2-android/settings.gradle', 'src/openrct2-android/app/build.gradle', 'src/openrct2-android/gradle.properties', 'src/openrct2-android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}-${{ needs.build_variables.outputs.tag }}-android-
- name: Setup keystore
run: |
echo "${{ secrets.OPENRCT2_KEYSTORE_CONTENTS }}" | base64 -d > keystore.jks
@@ -700,9 +704,15 @@ jobs:
echo "::warning title=Missing libraries::Warning: No libs found for $arch"
fi
done
- name: Download graphics .dat files
uses: actions/download-artifact@v7
with:
name: graphics-${{ needs.build_variables.outputs.name }}
path: bin/data
- name: Build OpenRCT2
run: |
. scripts/setenv
export OPENRCT2_DAT_DIR="$GITHUB_WORKSPACE/bin/data"
pushd src/openrct2-android
./gradlew app:assembleRelease -PskipNativeBuild
popd