diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 334867d..b918378 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,6 +82,10 @@ jobs: name: Build Android App runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + steps: - name: Checkout uses: actions/checkout@v5 @@ -98,6 +102,48 @@ jobs: - name: Build debug APK run: ./gradlew :app:assembleDebug + - name: Upload debug APK + id: upload_apk + if: always() && hashFiles('app/build/outputs/apk/debug/app-debug.apk') != '' + uses: actions/upload-artifact@v6 + with: + name: librechat-android-debug-${{ github.event.pull_request.number || github.sha }} + path: app/build/outputs/apk/debug/app-debug.apk + retention-days: 90 + if-no-files-found: error + + - name: Write APK summary + if: always() && steps.upload_apk.outputs.artifact-url != '' + env: + ARTIFACT_NAME: librechat-android-debug-${{ github.event.pull_request.number || github.sha }} + ARTIFACT_URL: ${{ steps.upload_apk.outputs.artifact-url }} + run: | + { + echo "## Android debug APK" + echo "" + echo "- **Artifact:** \`$ARTIFACT_NAME\`" + echo "- **Download:** [$ARTIFACT_NAME.zip]($ARTIFACT_URL)" + echo "- **Retention:** 90 days" + echo "" + echo "> Download requires a GitHub login. Installs over previous debug builds without uninstalling (stable signing key)." + } >> "$GITHUB_STEP_SUMMARY" + + - name: Post APK link to PR + if: always() && github.event_name == 'pull_request' && steps.upload_apk.outputs.artifact-url != '' + continue-on-error: true + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: android-debug-apk + message: | + ## Android debug APK + + **Artifact:** `librechat-android-debug-${{ github.event.pull_request.number }}` + **Download:** [librechat-android-debug-${{ github.event.pull_request.number }}.zip](${{ steps.upload_apk.outputs.artifact-url }}) + **Retention:** 90 days + **Commit:** `${{ github.event.pull_request.head.sha }}` + + > Download requires a GitHub login. Installs over previous debug builds without uninstalling (stable signing key). + ios: name: Build iOS App runs-on: macos-latest diff --git a/.gitignore b/.gitignore index b6306c6..7bc2dd1 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,7 @@ local.properties # Keystore *.jks *.keystore +!app/debug.keystore # OS .DS_Store diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ec8ce3c..8dc349f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -12,6 +12,15 @@ android { applicationId = "com.garfiec.librechat" } + signingConfigs { + getByName("debug") { + storeFile = file("debug.keystore") + storePassword = "android" + keyAlias = "androiddebugkey" + keyPassword = "android" + } + } + buildFeatures { buildConfig = true } diff --git a/app/debug.keystore b/app/debug.keystore new file mode 100644 index 0000000..6385957 Binary files /dev/null and b/app/debug.keystore differ