build: add android CD
This commit is contained in:
@ -42,3 +42,43 @@ jobs:
|
||||
rsync -avz -e "ssh -i private_key -o StrictHostKeyChecking=no" dist/ $DEPLOY_USER@$DEPLOY_HOST:$TARGET_PATH/
|
||||
|
||||
rm private_key
|
||||
build-android:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: latest
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
- name: Install dependencies
|
||||
run: bun i
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: "zulu"
|
||||
java-version: "17"
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@v3
|
||||
- name: Install NDK
|
||||
run: sdkmanager "ndk;27.0.11902837"
|
||||
- name: Install Rust stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
targets: aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android
|
||||
- name: Setup Android signing
|
||||
run: |
|
||||
cd src-tauri/gen/android
|
||||
echo "keyAlias=${{ secrets.ANDROID_KEY_ALIAS }}" > keystore.properties
|
||||
echo "password=${{ secrets.ANDROID_KEY_PASSWORD }}" >> keystore.properties
|
||||
base64 -d <<< "${{ secrets.ANDROID_KEY_BASE64 }}" > $RUNNER_TEMP/keystore.jks
|
||||
echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties
|
||||
echo "Keystore properties created."
|
||||
cd ../../.. # Go back to root
|
||||
- name: Build app bundle
|
||||
run: bun tauri android build -v --apk
|
||||
env:
|
||||
NDK_HOME: ${{ env.ANDROID_HOME }}/ndk/27.0.11902837
|
||||
- name: Upload apk
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: trafficcue.apk
|
||||
path: ./src-tauri/gen/android/app/build/outputs/apk/universal/release/app-universal-release.apk
|
||||
|
||||
Reference in New Issue
Block a user