Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .github/workflows/build-arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Build arm64-v8a APK

# Manual run: Actions tab -> "Build arm64-v8a APK" -> Run workflow.
# "debug" needs no secrets and installs on any device (debug-signed, package
# dev.mirutime.app.debug, so it can sit beside an official release).
# "release" signs with your keystore secrets (SIGNING_KEY base64,
# KEY_STORE_PASSWORD, ALIAS, KEY_PASSWORD) and keeps the normal package name.
on:
workflow_dispatch:
inputs:
build_type:
description: Build type
type: choice
options: [debug, release]
default: debug

permissions:
contents: read

concurrency:
group: build-arm64-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Set up JDK
uses: actions/setup-java@v6
with:
distribution: temurin
java-version: '21'

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6.3.0
with:
gradle-home-cache-cleanup: true

- name: Prepare release signing
if: inputs.build_type == 'release'
env:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
ALIAS: ${{ secrets.ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
if [ -z "$SIGNING_KEY" ]; then
echo "::error::Release build needs the SIGNING_KEY, KEY_STORE_PASSWORD, ALIAS and KEY_PASSWORD secrets. Use build type 'debug' otherwise."
exit 1
fi
printf '%s' "$SIGNING_KEY" | base64 --decode > app/storeFile.jks
{
echo "storeFile=$GITHUB_WORKSPACE/app/storeFile.jks"
echo "storePassword=$KEY_STORE_PASSWORD"
echo "keyAlias=$ALIAS"
echo "keyPassword=$KEY_PASSWORD"
} > custom.properties

- name: Build (arm64-v8a split)
env:
BUILD_TYPE: ${{ inputs.build_type }}
run: |
chmod +x gradlew
if [ "$BUILD_TYPE" = "release" ]; then
./gradlew --no-daemon --build-cache :app:assembleRelease \
-PabiSplits=true \
-PlocalPropertiesFilePath="$GITHUB_WORKSPACE/custom.properties"
else
./gradlew --no-daemon --build-cache :app:assembleDebug -PabiSplits=true
fi

- name: Collect arm64-v8a APK
env:
BUILD_TYPE: ${{ inputs.build_type }}
run: |
mkdir -p out
cp "app/build/outputs/apk/$BUILD_TYPE/app-arm64-v8a-$BUILD_TYPE.apk" \
"out/MiruTime-arm64-v8a-$BUILD_TYPE.apk"
ls -lh out

- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: MiruTime-arm64-v8a-${{ inputs.build_type }}
path: out/*.apk
if-no-files-found: error
Loading