Skip to content

doc: 2.0

doc: 2.0 #9

Workflow file for this run

name: CI Build
on:
workflow_dispatch:
push:
branches: [ main ]
tags: [ v* ]
paths-ignore:
- '*.md'
- '.github/**'
- '!.github/workflows/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Write key
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@v4
with:
repository: libxposed/api
path: libxposed/api
- name: Checkout libxposed/service
uses: actions/checkout@v4
with:
repository: libxposed/service
path: libxposed/service
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "21"
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
- name: Build dependencies
working-directory: libxposed
run: |
echo 'org.gradle.caching=true' >> ~/.gradle/gradle.properties
echo 'org.gradle.parallel=true' >> ~/.gradle/gradle.properties
echo 'org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -XX:+UseParallelGC' >> ~/.gradle/gradle.properties
echo 'android.native.buildOutput=verbose' >> ~/.gradle/gradle.properties
cd api
./gradlew publishToMavenLocal
cd ../service
./gradlew publishToMavenLocal
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
- name: Build with Gradle
run: |
./gradlew :app:assembleRelease
echo "RELEASE_APK_PATH=$(find app/build/outputs/apk/release -name '*.apk')" >> $GITHUB_ENV
if [ "${{ github.ref_type }}" == "tag" ]; then
echo "NAME_SUFFIX=${{ github.ref_name }}" >> $GITHUB_ENV
else
echo "NAME_SUFFIX=${{ github.event.head_commit.id }}" >> $GITHUB_ENV
fi
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
path: ${{ env.RELEASE_APK_PATH }}
name: MiCTS_${{ env.NAME_SUFFIX }}