Xiaomi Runner Config
Some checks failed
Android Build Final Fixed / build-android (push) Failing after 2m10s
Some checks failed
Android Build Final Fixed / build-android (push) Failing after 2m10s
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
name: Android Build Final
|
||||
name: Android Build Final Fixed
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build-android:
|
||||
runs-on: ubuntu-latest
|
||||
# Wir nehmen wieder das Node-Image, weil der Gitea-Checkout Node braucht.
|
||||
# Wir installieren Rust einfach schnell darin.
|
||||
container:
|
||||
image: node:20-bookworm
|
||||
|
||||
@@ -13,56 +11,74 @@ jobs:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install System & Rust
|
||||
- name: Install System Dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y build-essential curl wget file libssl-dev pkg-config openjdk-17-jdk git unzip libgtk-3-dev webkit2gtk-4.1 libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev python3
|
||||
# Rust installieren
|
||||
|
||||
- name: Install Rust
|
||||
run: |
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
rustup target add aarch64-linux-android
|
||||
# Trunk & Tauri-CLI installieren
|
||||
cargo install trunk tauri-cli
|
||||
|
||||
- name: Install Trunk & Tauri-CLI (Instant Download)
|
||||
run: |
|
||||
# Trunk Binärdatei direkt laden (spart 15 Min Kompilieren)
|
||||
wget -qO- https://github.com/trunk-rs/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf- -C /usr/local/bin
|
||||
# Tauri-CLI Binärdatei direkt laden
|
||||
wget -qO- https://github.com/tauri-apps/tauri/releases/latest/download/cargo-tauri-x86_64-unknown-linux-gnu.tgz | tar -xzf- -C /usr/local/bin
|
||||
chmod +x /usr/local/bin/trunk /usr/local/bin/cargo-tauri
|
||||
|
||||
- name: Setup Android SDK
|
||||
run: |
|
||||
export ANDROID_HOME=$HOME/android-sdk
|
||||
mkdir -p $ANDROID_HOME/cmdline-tools/temp
|
||||
cd $ANDROID_HOME/cmdline-tools/temp
|
||||
wget https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
|
||||
unzip *.zip
|
||||
wget -q https://dl.google.com/android/repository/commandlinetools-linux-9477386_latest.zip
|
||||
unzip -q *.zip
|
||||
mkdir -p ../latest
|
||||
cp -r cmdline-tools/* ../latest/
|
||||
cd ../..
|
||||
rm -rf cmdline-tools/temp
|
||||
yes | ./cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_HOME "platform-tools" "platforms;android-33" "build-tools;33.0.1" "ndk;25.1.8937393"
|
||||
yes | ./android-sdk/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_HOME "platform-tools" "platforms;android-33" "build-tools;33.0.1" "ndk;25.1.8937393"
|
||||
echo "ANDROID_HOME=$ANDROID_HOME" >> $GITHUB_ENV
|
||||
echo "NDK_HOME=$ANDROID_HOME/ndk/25.1.8937393" >> $GITHUB_ENV
|
||||
|
||||
- name: Build Android APK
|
||||
- name: Rust Cache
|
||||
uses: https://github.com/actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
~/.cargo/bin/
|
||||
~/.cargo/registry/index/
|
||||
~/.cargo/registry/cache/
|
||||
~/.cargo/git/db/
|
||||
target/
|
||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Build App
|
||||
run: |
|
||||
export PATH="$HOME/.cargo/bin:$PATH"
|
||||
export NDK_HOME=$HOME/android-sdk/ndk/25.1.8937393
|
||||
|
||||
# Da dein Repo in Bytemalte/marstemedia liegt:
|
||||
cd Bytemalte/marstemedia || echo "Schon im richtigen Verzeichnis"
|
||||
# In den Projektordner wechseln (Basierend auf deinem Log)
|
||||
cd Bytemalte/marstemedia || echo "Root"
|
||||
|
||||
# 1. Frontend bauen (wichtig für Tauri!)
|
||||
# Frontend bauen
|
||||
trunk build --release
|
||||
|
||||
# 2. Android initialisieren falls nötig
|
||||
# Android initialisieren falls nötig
|
||||
if [ ! -d "src-tauri/gen/android" ]; then
|
||||
cargo tauri android init
|
||||
cargo-tauri android init
|
||||
fi
|
||||
|
||||
# 3. APK bauen
|
||||
cargo tauri android build --target aarch64
|
||||
# Finaler Build
|
||||
cargo-tauri android build --target aarch64
|
||||
env:
|
||||
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
|
||||
|
||||
- name: Upload APK Artifact
|
||||
- name: Upload APK
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Xiaomi-App
|
||||
path: "**/src-tauri/gen/android/app/build/outputs/apk/release/*.apk"
|
||||
path: "**/build/outputs/apk/release/*.apk"
|
||||
|
||||
Reference in New Issue
Block a user