diff --git a/.github/workflows/android-deploy.yaml b/.github/workflows/android-deploy.yaml new file mode 100644 index 000000000..d50b0a618 --- /dev/null +++ b/.github/workflows/android-deploy.yaml @@ -0,0 +1,87 @@ +name: Android Prod Deploy + +on: + push: + tags: + - android-* + workflow_dispatch: + +concurrency: + group: android-prod + +jobs: + build-android: + name: Build for Android + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + pull-requests: write + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/setup + with: + java: true + kotlin-cache: true + rsvg: true + ruby: true + gcp-provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} + gcp-service-account: ${{ secrets.GCP_SERVICE_ACCOUNT }} + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: ${{ secrets.AWS_ROLE_ARN }} + aws-region: us-east-1 + - name: Fetch AWS secrets + uses: aws-actions/aws-secretsmanager-get-secrets@v2 + with: + secret-ids: | + mobile-app-android-upload-key-passphrase + - name: Load code signing key + run: | + cd androidApp + aws secretsmanager get-secret-value --secret-id mobile-app-android-upload-key --output json | jq -r '.SecretBinary' | base64 --decode > upload-keystore.jks + - name: Build Android app + env: + KEYSTORE_FILE: "${{ github.workspace }}/androidApp/upload-keystore.jks" + KEYSTORE_PASSWORD: ${{ env.MOBILE_APP_ANDROID_UPLOAD_KEY_PASSPHRASE }} + KEY_ALIAS: "upload" + KEY_PASSWORD: ${{ env.MOBILE_APP_ANDROID_UPLOAD_KEY_PASSPHRASE }} + MAPBOX_SECRET_TOKEN: ${{ secrets.MAPBOX_SECRET_TOKEN }} + SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} + run: | + bundle exec fastlane android build flavor:Prod + - uses: actions/upload-artifact@v4 + with: + name: android-apk + path: androidApp/build/outputs/apk/prod/release/androidApp-prod-release.apk + - uses: actions/upload-artifact@v4 + with: + name: android-aab + path: androidApp/build/outputs/bundle/prodRelease/androidApp-prod-release.aab + deploy-android: + name: Upload to Google Play + concurrency: + group: deploy-android + cancel-in-progress: false + needs: + - build-android + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + pull-requests: write + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: android-aab + path: androidApp/build/outputs/bundle/prodRelease + - uses: ./.github/actions/setup + with: + gcp-provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} + gcp-service-account: ${{ secrets.GCP_SERVICE_ACCOUNT }} + ruby: true + - name: Upload to Google Play + run: | + bundle exec fastlane android internal flavor:Prod diff --git a/README.md b/README.md index 3f9629776..528ebbc92 100644 --- a/README.md +++ b/README.md @@ -148,8 +148,8 @@ aws secretsmanager get-secret-value --secret-id mobile-app-android-upload-key-pa ### Production Deploys -Pushing a new tag will automatically deploy to the internal testing group (on iOS), and then release notes can be added and the build can be more widely published manually. +Pushing a new tag with the `ios-` prefix will automatically deploy to the iOS internal testing group, and then release notes can be added and the build can be more widely published manually. -The tag should match the version exactly - no `v` prefix - and the version needs to be set beforehand in `iosApp/iosApp/Info.plist`. +Pushing a new tag with the `android-` prefix will automatically deploy to the Android internal testing group, and then release notes can be added and the build can be promoted to testing/prod manually. -Android production deploys aren't set up yet. +The tag should be `-X.Y.Z` - no `v` prefix - and the version needs to be set beforehand in `iosApp/iosApp/Info.plist` and/or `androidApp/build.gradle.kts`. diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index 497d8a7d8..db63c1c3e 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -34,7 +34,7 @@ android { targetSdk = 34 versionCode = Integer.parseInt((findProperty("android.injected.version.code") ?: "1") as String) - versionName = (findProperty("android.injected.version.name") ?: "0.1.0") as String + versionName = "0.2.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } buildFeatures { diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 39d47a9f0..da52a6ebe 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -36,8 +36,6 @@ platform :android do "android.injected.signing.key.alias" => ENV["KEY_ALIAS"], "android.injected.signing.key.password" => ENV["KEY_PASSWORD"], "android.injected.version.code" => next_version_code, - # TODO: Define the version name once and share it between iOS and Android - "android.injected.version.name" => "0.1.0", } gradle( task: 'assemble', diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4657d0ae4..bb33f0693 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ accompanist = "0.36.0" android-material3 = "1.3.1" androidx-activityCompose = "1.9.1" -androidx-navigationCompose = "2.8.1" +androidx-navigationCompose = "2.8.5" androidx-test-monitor = "1.7.2" androidx-test-rules = "1.6.1" agp = "8.5.2" @@ -20,7 +20,7 @@ kotlinxDatetime = "0.6.1" ktor = "3.0.2" mapbox = "11.3.0" mapboxTurf = "6.15.0" -mokkery = "2.6.0" +mokkery = "2.6.1" okhttp = "4.12.0" okio = "3.9.1" playServicesLocation = "21.3.0"