mirror of
https://github.com/WiVRn/WiVRn.git
synced 2026-11-24 11:01:43 -08:00
Every Android job downloads gradle-8.13-bin.zip and the whole Android plugin dependency tree from Maven Central on each run, so a Maven Central 403 fails the build before it configures anything: Could not GET '.../kotlin-stdlib-2.2.0.pom'. Received status code 403 from server: Forbidden Cache ~/.gradle/caches and ~/.gradle/wrapper, keyed on the wrapper properties and build.gradle.
137 lines
4.1 KiB
YAML
137 lines
4.1 KiB
YAML
name: Release APK Only
|
|
|
|
on:
|
|
push:
|
|
branches: [ "master" ]
|
|
|
|
env:
|
|
BUILD_TYPE: RelWithDebInfo
|
|
|
|
jobs:
|
|
build-android-only:
|
|
name: Android
|
|
runs-on: ubuntu-24.04
|
|
if: ${{ vars.APK_ONLY != '' }}
|
|
|
|
strategy:
|
|
matrix:
|
|
buildtype: ['Release', 'Debug', 'DebugWithValidationLayer']
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
# Checkout from upstream instead of WiVRn-APK to ensure the GIT_DESC variable is set correctly
|
|
repository: 'WiVRn/WiVRn'
|
|
ref: ${{ github.sha }}
|
|
fetch-depth: 0
|
|
|
|
# Gradle distribution and the Android plugin's dependencies.
|
|
- uses: actions/cache@v5
|
|
with:
|
|
key: gradle-android-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle') }}
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
restore-keys: gradle-android-
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update && sudo apt-get install glslang-tools spirv-tools librsvg2-bin gettext npm
|
|
wget https://github.com/KhronosGroup/KTX-Software/releases/download/v4.4.0/KTX-Software-4.4.0-Linux-x86_64.deb
|
|
sudo dpkg --install KTX-Software-4.4.0-Linux-x86_64.deb
|
|
npm install --global @gltf-transform/[email protected]
|
|
|
|
- name: Check for Secret availability
|
|
id: secret-check
|
|
shell: bash
|
|
run: |
|
|
if [[ "${{ secrets.APK_SIGNINGKEYPASSWORD }}" != '' && "${{ secrets.APK_KEYSTORE_BASE64 }}" != '' ]]; then
|
|
echo "available=true" >> $GITHUB_OUTPUT;
|
|
else
|
|
echo "available=false" >> $GITHUB_OUTPUT;
|
|
fi
|
|
|
|
- name: Secrets
|
|
if: ${{ github.event_name != 'pull_request' && steps.secret-check.outputs.available == 'true' }}
|
|
env:
|
|
APK_SIGNINGKEYPASSWORD: ${{ secrets.APK_SIGNINGKEYPASSWORD }}
|
|
APK_KEYSTORE_BASE64: ${{ secrets.APK_KEYSTORE_BASE64 }}
|
|
run: |
|
|
echo signingKeyPassword="$APK_SIGNINGKEYPASSWORD" > gradle.properties
|
|
echo "$APK_KEYSTORE_BASE64" | base64 --decode --ignore-garbage > ks.keystore
|
|
|
|
- name: Build
|
|
run: |
|
|
chmod +x gradlew
|
|
./gradlew -Psuffix=".github.nightly" -Pwivrn_css=images/wivrn-nightly.css -Pwivrn_app_name="WiVRn Nightly" -Pwivrn_compress_glb=ON assemble${{ matrix.buildtype }}
|
|
|
|
- name: Prepare before archiving artifacts
|
|
run: |
|
|
mkdir apk
|
|
mv $(find build/outputs/apk/ -name "*.apk") apk/
|
|
mkdir debug
|
|
mv build/intermediates/merged_native_libs/*/*/out/lib/* debug/
|
|
find debug -name libopenxr_loader.so -delete
|
|
|
|
- name: Archive APK
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: apk-${{ (github.event_name == 'pull_request' && matrix.buildtype == 'Release') && 'Release-unsigned' || matrix.buildtype }}
|
|
path: apk/*.apk
|
|
retention-days: 7
|
|
|
|
- name: Archive debug symbols
|
|
if: ${{ matrix.buildtype != 'Release' }}
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: symbols-${{ matrix.buildtype }}
|
|
path: debug/**/*.so
|
|
retention-days: 7
|
|
|
|
release:
|
|
name: Create APK release
|
|
runs-on: ubuntu-24.04
|
|
needs: build-android-only
|
|
if: ${{ vars.APK_ONLY != '' }}
|
|
|
|
steps:
|
|
- name: Download APK artifacts
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
path: apk
|
|
pattern: 'apk-*'
|
|
merge-multiple: true
|
|
|
|
- name: Rename APK artifacts
|
|
run: |
|
|
cd apk
|
|
for f in *.apk; do
|
|
BASENAME=`echo ${f}|awk -F '-APK-' '{print $2}'`
|
|
mv "${f}" "org.meumeu.wivrn-${BASENAME}"
|
|
done
|
|
|
|
- name: Download APK debug artifacts
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
path: symbols
|
|
pattern: 'symbols-*'
|
|
merge-multiple: false
|
|
|
|
- name: Zip APK debug artifacts
|
|
run: |
|
|
cd symbols
|
|
zip -r ../debug-symbols.zip .
|
|
|
|
- name: APK Release
|
|
uses: softprops/action-gh-release@v3
|
|
with:
|
|
token: ${{ secrets.DOWNSTREAM_GITHUB_TOKEN }}
|
|
tag_name: "apk-${{ github.sha }}"
|
|
generate_release_notes: true
|
|
draft: false
|
|
prerelease: false
|
|
fail_on_unmatched_files: true
|
|
files: |
|
|
apk/*.apk
|
|
debug-symbols.zip
|