Added invert selection in group feature to krokiet UI. (#1915)
#72
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 🤖 Android APK | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| pull_request: | |
| branches: [ master, main ] | |
| workflow_dispatch: | |
| jobs: | |
| build-apk: | |
| name: Build Android APK | |
| runs-on: ubuntu-latest | |
| env: | |
| # NDK releases: https://developer.android.com/ndk/downloads/revision_history | |
| # Latest stable NDK r27 (27.2.12479018) | |
| NDK_VERSION: 27.2.12479018 | |
| # API levels & cumulative device share: https://apilevels.com/ | |
| # 21=Android 5.0 (99.8%), 26=Android 8.0 (94.8%), 28=Android 9.0 (91.8%) | |
| # Google Play min target SDK policy: https://developer.android.com/google/play/requirements/target-sdk | |
| MIN_SDK_VERSION: 26 | |
| # target_sdk_version: Google Play requires ≥34 now, ≥35 from 2025-08-31 | |
| TARGET_SDK_VERSION: 35 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Set up Java (required by Android SDK) | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '17' | |
| - name: Set up Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install Android NDK, platforms and Rust targets | |
| run: | | |
| rustup target add aarch64-linux-android | |
| cargo install cargo-apk || true | |
| yes | sdkmanager --install \ | |
| "ndk;${NDK_VERSION}" \ | |
| "platforms;android-${TARGET_SDK_VERSION}" \ | |
| "build-tools;${TARGET_SDK_VERSION}.0.0" | |
| echo "ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/${NDK_VERSION}" >> $GITHUB_ENV | |
| - name: Generate keystores | |
| run: | | |
| sudo apt update || true | |
| sudo apt install -y just | |
| echo "123456" > keystore_pass | |
| just gen_keystores | |
| PASS=$(cat keystore_pass) | |
| sed -i "s|TO_REPLACE_KEYSTORE_PASSWORD|$PASS|g" cedinia/Cargo.toml | |
| - name: Patch Cargo.toml - set min/target SDK versions | |
| run: | | |
| sed -i "s/min_sdk_version = .*/min_sdk_version = ${MIN_SDK_VERSION}/" cedinia/Cargo.toml | |
| sed -i "s/target_sdk_version = .*/target_sdk_version = ${TARGET_SDK_VERSION}/" cedinia/Cargo.toml | |
| - name: Patch Cargo.toml - enable LTO and codegen-units for release | |
| if: ${{ github.ref == 'refs/heads/master' }} | |
| run: | | |
| sed -i 's/#lto = /lto = /g' Cargo.toml | |
| sed -i 's/#codegen-units /codegen-units /g' Cargo.toml | |
| - name: Build APK (release) | |
| if: ${{ github.ref == 'refs/heads/master' }} | |
| run: | | |
| echo "VERS=release" >> $GITHUB_ENV | |
| cargo apk build -p cedinia --lib --release --target aarch64-linux-android | |
| mv target/release/apk/cedinia.apk cedinia.apk | |
| - name: Build APK (debug) | |
| if: ${{ github.ref != 'refs/heads/master' }} | |
| run: | | |
| echo "VERS=debug" >> $GITHUB_ENV | |
| cargo apk build -p cedinia --lib --target aarch64-linux-android | |
| mv target/debug/apk/cedinia.apk cedinia.apk | |
| - name: Set up Gradle for AAB build | |
| uses: gradle/actions/setup-gradle@v3 | |
| with: | |
| gradle-version: '8.9' | |
| - name: Build AAB | |
| run: | | |
| mkdir -p cedinia/android/app/src/main/jniLibs/arm64-v8a | |
| cp target/aarch64-linux-android/${{ env.VERS }}/libcedinia.so \ | |
| cedinia/android/app/src/main/jniLibs/arm64-v8a/ | |
| cd cedinia/android | |
| gradle bundleRelease | |
| mv app/build/outputs/bundle/release/app-release.aab ../../cedinia.aab | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: cedinia-${{ env.VERS }}-apk | |
| path: | | |
| cedinia.aab | |
| cedinia.apk | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| if: ${{ github.ref == 'refs/heads/master' && vars.HAVE_PAT_REPOSITORY_TOKEN == '1' }} | |
| with: | |
| tag_name: "Nightly" | |
| files: | | |
| cedinia.apk | |
| cedinia.aab | |
| token: ${{ secrets.PAT_REPOSITORY }} |