From fefb5c837bc0877ded987af700ca0a85246d9e73 Mon Sep 17 00:00:00 2001 From: dom Date: Sat, 7 Mar 2026 13:43:08 +0800 Subject: [PATCH] build Signed-off-by: dom --- .github/workflows/build.yml | 20 ++++++++++++++++---- android/app/build.gradle.kts | 8 ++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cba54824e..dce94326f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ on: jobs: android: - if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_android == 'true' }} + if: ${{ (github.event_name == 'pull_request' && github.repository == 'bggRGjQaUbCoE/PiliPlus') || github.event.inputs.build_android == 'true' }} name: Release Android runs-on: ubuntu-latest permissions: write-all @@ -95,12 +95,24 @@ jobs: fi - name: Set and Extract version + if: ${{ github.event_name == 'workflow_dispatch' }} shell: pwsh run: lib/scripts/build.ps1 android - - name: Flutter Build Apk + - name: Flutter Build Release Apk + if: ${{ github.event_name == 'workflow_dispatch' }} run: flutter build apk --release --split-per-abi --dart-define-from-file=pili_release.json --pub + - name: Flutter Build Dev Apk + if: ${{ github.event_name == 'pull_request' }} + run: | + echo "${{ secrets.SIGN_KEYSTORE_BASE64_DEV }}" | base64 --decode > android/app/dev.jks + echo storeFile='dev.jks' >> android/key.properties + echo storePassword='${{ secrets.KEYSTORE_PASSWORD_DEV }}' >> android/key.properties + echo keyAlias='${{ secrets.KEY_ALIAS_DEV }}' >> android/key.properties + echo keyPassword='${{ secrets.KEY_PASSWORD_DEV }}' >> android/key.properties + flutter build apk --release --split-per-abi --android-project-arg dev=1 --pub + - name: Rename run: | for file in build/app/outputs/flutter-apk/app-*-release.apk; do @@ -139,7 +151,7 @@ jobs: path: PiliPlus_android_*_x86_64.apk ios: - if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_ios == 'true' }} + if: ${{ (github.event_name == 'pull_request' && github.repository == 'bggRGjQaUbCoE/PiliPlus') || github.event.inputs.build_ios == 'true' }} uses: ./.github/workflows/ios.yml permissions: write-all with: @@ -153,7 +165,7 @@ jobs: tag: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || '' }} win_x64: - if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_win_x64 == 'true' }} + if: ${{ (github.event_name == 'pull_request' && github.repository == 'bggRGjQaUbCoE/PiliPlus') || github.event.inputs.build_win_x64 == 'true' }} uses: ./.github/workflows/win_x64.yml permissions: write-all with: diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index d464b879b..5e8c02344 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -54,6 +54,14 @@ android { signingConfig = config ?: signingConfigs["debug"] } release { + if (project.hasProperty("dev")) { + applicationIdSuffix = ".dev" + resValue( + type = "string", + name = "app_name", + value = "PiliPlus dev", + ) + } proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"