138 lines
3.9 KiB
YAML
138 lines
3.9 KiB
YAML
name: Build CI
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
merge_group:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: macos-latest
|
|
env:
|
|
CCACHE_COMPILERCHECK: '%compiler% -dumpmachine; %compiler% -dumpversion'
|
|
CCACHE_NOHASHDIR: 'true'
|
|
CCACHE_HARDLINK: 'true'
|
|
CCACHE_BASEDIR: ${{ github.workspace }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
fetch-depth: 0
|
|
|
|
- name: Cache Gradle
|
|
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: Cache Maven local repo
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.m2/repository
|
|
key: ${{ runner.os }}-m2-${{ hashFiles('**/build.gradle*') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-m2-
|
|
|
|
- name: Cache ccache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.ccache
|
|
key: ${{ runner.os }}-ccache-${{ hashFiles('**/src/**/*.cpp', '**/src/**/*.h', '**/CMakeLists.txt') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-ccache-
|
|
|
|
- name: Write signing key if needed
|
|
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
|
|
run: |
|
|
if [ ! -z "${{ secrets.KEY_STORE }}" ]; then
|
|
echo androidStorePassword='${{ secrets.KEY_STORE_PASSWORD }}' >> gradle.properties
|
|
echo androidKeyAlias='${{ secrets.ALIAS }}' >> gradle.properties
|
|
echo androidKeyPassword='${{ secrets.KEY_PASSWORD }}' >> gradle.properties
|
|
echo androidStoreFile='key.jks' >> gradle.properties
|
|
echo ${{ secrets.KEY_STORE }} | base64 --decode > key.jks
|
|
fi
|
|
|
|
- name: Checkout libxposed/api
|
|
uses: actions/checkout@main
|
|
with:
|
|
repository: libxposed/api
|
|
path: libxposed/api
|
|
ref: 54582730315ba4a3d7cfaf9baf9d23c419e07006
|
|
|
|
- name: Checkout libxposed/service
|
|
uses: actions/checkout@main
|
|
with:
|
|
repository: libxposed/service
|
|
path: libxposed/service
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
java-version: '21'
|
|
distribution: 'adopt'
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@v4
|
|
|
|
- name: Setup Android SDK
|
|
uses: android-actions/setup-android@v3
|
|
|
|
- name: Setup ninja
|
|
uses: seanmiddleditch/gha-setup-ninja@master
|
|
with:
|
|
version: 1.12.0
|
|
|
|
- name: Remove Android's cmake
|
|
run: rm -rf $ANDROID_HOME/cmake
|
|
|
|
- name: Build local dependencies
|
|
run: |
|
|
echo "--- Building API dependency ---"
|
|
cd libxposed/api
|
|
./gradlew :api:publishApiPublicationToMavenLocal --no-daemon
|
|
echo "--- Building Service Interface dependency ---"
|
|
cd ../service
|
|
./gradlew :interface:publishInterfacePublicationToMavenLocal --no-daemon
|
|
|
|
- name: Set short commit id
|
|
run: echo "commit=$(echo ${{ github.sha }} | cut -c-7)" >> $GITHUB_ENV
|
|
|
|
- name: Build with Gradle
|
|
run: |
|
|
echo 'org.gradle.parallel=true' >> gradle.properties
|
|
echo 'org.gradle.jvmargs=-Xmx3g' >> gradle.properties
|
|
echo 'android.native.buildOutput=verbose' >> gradle.properties
|
|
./gradlew buildAll
|
|
|
|
- name: Upload Debug artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: npatch-debug
|
|
path: out/debug/*
|
|
|
|
- name: Upload Release artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: npatch-release
|
|
path: out/release/*
|
|
|
|
- name: Upload mappings
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: mappings
|
|
path: |
|
|
patch-loader/build/outputs/mapping
|
|
manager/build/outputs/mapping
|
|
|
|
- name: Upload symbols
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: symbols
|
|
path: |
|
|
patch-loader/build/symbols |