mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
77 lines
2.3 KiB
YAML
77 lines
2.3 KiB
YAML
name: Upload Preview APK
|
|
|
|
on: pull_request
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
jobs:
|
|
build:
|
|
name: Upload Preview APK
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Validate Fastlane Metadata
|
|
uses: ashutoshgngwr/validate-fastlane-supply-metadata@v2
|
|
|
|
- uses: actions/setup-java@v5
|
|
with:
|
|
java-version: 17
|
|
distribution: 'temurin'
|
|
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: Validate Gradle Wrapper
|
|
uses: gradle/actions/wrapper-validation@v4
|
|
|
|
- uses: android-actions/setup-android@v3
|
|
- uses: nttld/setup-ndk@v1
|
|
id: setup-ndk
|
|
with:
|
|
ndk-version: r27
|
|
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: jni/deltachat-core-rust
|
|
|
|
- name: Get deltachat-core-rust submodule hash
|
|
id: core-hash
|
|
run: echo "hash=$(git rev-parse HEAD:jni/deltachat-core-rust)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Restore compiled core
|
|
id: core-cache
|
|
uses: actions/cache/restore@v4
|
|
with:
|
|
path: |
|
|
jni/arm64-v8a
|
|
libs/arm64-v8a
|
|
key: core-arm64-v8a-${{ steps.core-hash.outputs.hash }}-${{ hashFiles('jni/Android.mk', 'jni/Application.mk', 'jni/dc_wrapper.c', 'scripts/ndk-make.sh') }}-ndk-r27
|
|
|
|
- name: Compile core
|
|
if: steps.core-cache.outputs.cache-hit != 'true'
|
|
env:
|
|
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
|
|
run: |
|
|
export PATH="${PATH}:${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/"
|
|
scripts/install-toolchains.sh && scripts/ndk-make.sh arm64-v8a
|
|
|
|
- name: Build APK
|
|
run: ./gradlew --no-daemon -PABI_FILTER=arm64-v8a assembleFossDebug
|
|
|
|
- name: Upload APK
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: app-preview.apk
|
|
path: 'build/outputs/apk/foss/debug/*.apk'
|