From 3e5d38da0a094db7a77df05943e302730959796d Mon Sep 17 00:00:00 2001 From: Florent Maitre Date: Thu, 31 Oct 2024 16:17:56 +0100 Subject: [PATCH] Update app launcher icon --- .github/actions/app-distribution/action.yml | 8 +- ...-review.yml => app-distribution-alpha.yml} | 10 +- ...on-daily.yml => app-distribution-beta.yml} | 10 +- .github/workflows/build.yml | 6 +- app/build.gradle.kts | 18 +- app/google-services.json | 38 ++++ .../res/drawable/ic_launcher_background.xml | 0 .../res/drawable/ic_launcher_foreground.xml | 21 +++ .../res/drawable/ic_launcher_background.xml | 170 ++++++++++++++++++ .../res/drawable/ic_launcher_foreground.xml | 21 +++ .../res/drawable/ic_launcher_foreground.xml | 30 ---- .../res/drawable/ic_launcher_background.xml | 170 ++++++++++++++++++ .../res/drawable/ic_launcher_foreground.xml | 5 + .../MavenCentralPublishPluginExtension.kt | 2 +- buildSrc/src/main/kotlin/release.gradle.kts | 2 +- 15 files changed, 461 insertions(+), 50 deletions(-) rename .github/workflows/{app-distribution-review.yml => app-distribution-alpha.yml} (90%) rename .github/workflows/{app-distribution-daily.yml => app-distribution-beta.yml} (84%) rename app/src/{main => alpha}/res/drawable/ic_launcher_background.xml (100%) create mode 100644 app/src/alpha/res/drawable/ic_launcher_foreground.xml create mode 100644 app/src/beta/res/drawable/ic_launcher_background.xml create mode 100644 app/src/beta/res/drawable/ic_launcher_foreground.xml delete mode 100644 app/src/main/res/drawable/ic_launcher_foreground.xml create mode 100644 app/src/prod/res/drawable/ic_launcher_background.xml create mode 100644 app/src/prod/res/drawable/ic_launcher_foreground.xml diff --git a/.github/actions/app-distribution/action.yml b/.github/actions/app-distribution/action.yml index 71783040..39fad6d0 100644 --- a/.github/actions/app-distribution/action.yml +++ b/.github/actions/app-distribution/action.yml @@ -7,9 +7,9 @@ inputs: description: Indicates if short Git SHA should be appended to the version name required: false default: 'false' - application-id: - description: Application ID - required: false + variant: + description: Variant + required: true firebase-token: description: Firebase token required: true @@ -34,7 +34,7 @@ runs: BRANCH_SHA=${{ github.event.pull_request.head.sha }} COMMIT_SHA=${BRANCH_SHA:-$GITHUB_SHA} [ ${{ inputs.append-git-sha-to-version-name }} == 'true' ] && VERSION_NAME_SUFFIX=-${COMMIT_SHA::7} || VERSION_NAME_SUFFIX='' - ./gradlew :app:appDistributionUpload -PversionNameSuffix=$VERSION_NAME_SUFFIX -PversionCode=$GITHUB_RUN_NUMBER -PappDistributionVariants=release -PapplicationId=${{ inputs.application-id }} -PappDistributionGitTagPrefix=${{ inputs.git-tag-prefix }} -PappDistributionGroup=${{ inputs.group }} -PappDistributionGitTagSha=$COMMIT_SHA --stacktrace + ./gradlew :app:appDistributionUpload -PversionNameSuffix=$VERSION_NAME_SUFFIX -PversionCode=$GITHUB_RUN_NUMBER -PappDistributionVariants=${{ inputs.variant }} -PappDistributionGitTagPrefix=${{ inputs.git-tag-prefix }} -PappDistributionGroup=${{ inputs.group }} -PappDistributionGitTagSha=$COMMIT_SHA --stacktrace env: GITHUB_TOKEN: ${{ inputs.github-token }} FIREBASE_TOKEN: ${{ inputs.firebase-token }} diff --git a/.github/workflows/app-distribution-review.yml b/.github/workflows/app-distribution-alpha.yml similarity index 90% rename from .github/workflows/app-distribution-review.yml rename to .github/workflows/app-distribution-alpha.yml index 53e8d545..4b00eb78 100644 --- a/.github/workflows/app-distribution-review.yml +++ b/.github/workflows/app-distribution-alpha.yml @@ -1,4 +1,4 @@ -name: app-distribution-review +name: app-distribution-alpha on: workflow_dispatch: @@ -10,7 +10,7 @@ on: - unlabeled jobs: - app-distribution-review: + app-distribution-alpha: runs-on: ubuntu-latest if: github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'tokenator-update-tokens-')) steps: @@ -44,11 +44,11 @@ jobs: uses: ./.github/actions/app-distribution with: append-git-sha-to-version-name: 'true' - application-id: 'com.orange.ouds.review.app' + variant: 'alphaRelease' firebase-token: ${{ secrets.FIREBASE_TOKEN }} - git-tag-prefix: 'ci/review-app' + git-tag-prefix: 'ci/alpha-app' github-token: ${{ secrets.GITHUB_TOKEN }} - group: 'ouds-android-review' + group: 'ouds-android-alpha' - name: Publish Firebase App Distribution QR code run: ./gradlew publishAppDistributionQrCode diff --git a/.github/workflows/app-distribution-daily.yml b/.github/workflows/app-distribution-beta.yml similarity index 84% rename from .github/workflows/app-distribution-daily.yml rename to .github/workflows/app-distribution-beta.yml index ea34b623..9a44a841 100644 --- a/.github/workflows/app-distribution-daily.yml +++ b/.github/workflows/app-distribution-beta.yml @@ -1,4 +1,4 @@ -name: app-distribution-daily +name: app-distribution-beta on: schedule: @@ -6,7 +6,7 @@ on: workflow_dispatch: jobs: - app-distribution-daily: + app-distribution-beta: runs-on: ubuntu-latest if: github.repository == 'Orange-OpenSource/ouds-android' steps: @@ -33,8 +33,8 @@ jobs: uses: ./.github/actions/app-distribution with: append-git-sha-to-version-name: 'true' - application-id: 'com.orange.ouds.test.app' + variant: 'betaRelease' firebase-token: ${{ secrets.FIREBASE_TOKEN }} - git-tag-prefix: 'ci/daily-app' + git-tag-prefix: 'ci/beta-app' github-token: ${{ secrets.GITHUB_TOKEN }} - group: 'ouds-android-test' + group: 'ouds-android-beta' diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ad30d15..2fb70fd3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,7 +53,7 @@ jobs: run: ./gradlew :core:verifyPaparazziDebug - name: Run Android Linter - run: ./gradlew lint + run: ./gradlew lintProdDebug lintProdRelease - name: Build run: | @@ -61,7 +61,7 @@ jobs: # This value is unset if workflow has not been triggered by a pull request, use GITHUB_SHA instead BRANCH_SHA=${{ github.event.pull_request.head.sha }} COMMIT_SHA=${BRANCH_SHA:-$GITHUB_SHA} - ./gradlew assemble -PversionNameSuffix="-${COMMIT_SHA::7}" -PversionCode=$GITHUB_RUN_NUMBER --stacktrace + ./gradlew assembleProd -PversionNameSuffix="-${COMMIT_SHA::7}" -PversionCode=$GITHUB_RUN_NUMBER --stacktrace - name: Store tests artifacts if: always() @@ -78,7 +78,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: app - path: app/build/outputs/apk/*/*.apk + path: app/build/outputs/apk/*/*/*.apk - name: Store core artifacts uses: actions/upload-artifact@v4 diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 00f1e72e..357470db 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -31,7 +31,6 @@ android { compileSdk = libs.versions.androidCompileSdk.get().toInt() defaultConfig { - applicationId = project.findTypedProperty("applicationId") ?: "com.orange.ouds.app" minSdk = libs.versions.androidMinSdk.get().toInt() targetSdk = libs.versions.androidTargetSdk.get().toInt() versionCode = project.findTypedProperty("versionCode")?.toInt() ?: 1 @@ -77,6 +76,23 @@ android { } } + val versionFlavorDimension = "version" + flavorDimensions.add(versionFlavorDimension) + productFlavors { + create("alpha") { + dimension = versionFlavorDimension + applicationId = "com.orange.ouds.alpha.app" + } + create("beta") { + dimension = versionFlavorDimension + applicationId = "com.orange.ouds.beta.app" + } + create("prod") { + dimension = versionFlavorDimension + applicationId = "com.orange.ouds.app" + } + } + kotlin { jvmToolchain(17) compilerOptions { diff --git a/app/google-services.json b/app/google-services.json index 5398d5eb..04294573 100644 --- a/app/google-services.json +++ b/app/google-services.json @@ -5,6 +5,25 @@ "storage_bucket": "ouds-f91d8.appspot.com" }, "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:756919609448:android:22744c13139c261a54f3dd", + "android_client_info": { + "package_name": "com.orange.ouds.alpha.app" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCAqxL90WNlSvstZOmrIZIMwS68GunWRDE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + }, { "client_info": { "mobilesdk_app_id": "1:756919609448:android:635d277f6d88a44154f3dd", @@ -24,6 +43,25 @@ } } }, + { + "client_info": { + "mobilesdk_app_id": "1:756919609448:android:ceefd1e4efd5d68654f3dd", + "android_client_info": { + "package_name": "com.orange.ouds.beta.app" + } + }, + "oauth_client": [], + "api_key": [ + { + "current_key": "AIzaSyCAqxL90WNlSvstZOmrIZIMwS68GunWRDE" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [] + } + } + }, { "client_info": { "mobilesdk_app_id": "1:756919609448:android:08045c141d8ea56d54f3dd", diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/alpha/res/drawable/ic_launcher_background.xml similarity index 100% rename from app/src/main/res/drawable/ic_launcher_background.xml rename to app/src/alpha/res/drawable/ic_launcher_background.xml diff --git a/app/src/alpha/res/drawable/ic_launcher_foreground.xml b/app/src/alpha/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 00000000..317d4bcc --- /dev/null +++ b/app/src/alpha/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/beta/res/drawable/ic_launcher_background.xml b/app/src/beta/res/drawable/ic_launcher_background.xml new file mode 100644 index 00000000..07d5da9c --- /dev/null +++ b/app/src/beta/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/beta/res/drawable/ic_launcher_foreground.xml b/app/src/beta/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 00000000..4d59164d --- /dev/null +++ b/app/src/beta/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml deleted file mode 100644 index 2b068d11..00000000 --- a/app/src/main/res/drawable/ic_launcher_foreground.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/prod/res/drawable/ic_launcher_background.xml b/app/src/prod/res/drawable/ic_launcher_background.xml new file mode 100644 index 00000000..07d5da9c --- /dev/null +++ b/app/src/prod/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/prod/res/drawable/ic_launcher_foreground.xml b/app/src/prod/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 00000000..1efb8819 --- /dev/null +++ b/app/src/prod/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/buildSrc/src/main/kotlin/com/orange/ouds/gradle/MavenCentralPublishPluginExtension.kt b/buildSrc/src/main/kotlin/com/orange/ouds/gradle/MavenCentralPublishPluginExtension.kt index 61f8d7c4..fde5af92 100644 --- a/buildSrc/src/main/kotlin/com/orange/ouds/gradle/MavenCentralPublishPluginExtension.kt +++ b/buildSrc/src/main/kotlin/com/orange/ouds/gradle/MavenCentralPublishPluginExtension.kt @@ -16,7 +16,7 @@ abstract class MavenCentralPublishPluginExtension { companion object { const val NAME = "mavenCentralPublish" - const val VARIANT = "release" + const val VARIANT = "prodRelease" } var artifactId: String? = null diff --git a/buildSrc/src/main/kotlin/release.gradle.kts b/buildSrc/src/main/kotlin/release.gradle.kts index a209e13e..b6e52573 100644 --- a/buildSrc/src/main/kotlin/release.gradle.kts +++ b/buildSrc/src/main/kotlin/release.gradle.kts @@ -71,7 +71,7 @@ fun updateChangelog(version: String) { val gitChangelogApi = createGitChangelogApi() .withUntaggedName(version) // Group unreleased commits under the new version tag - .withIgnoreTagsIfNameMatches("^refs/tags/ci/(daily|review)-.*") // Ignore ci/daily and ci/review tags + .withIgnoreTagsIfNameMatches("^refs/tags/ci/.*") // Ignore CI tags .withTemplatePath("CHANGELOG.mustache") // Use a Mustache template to generate changelog .withHandlebarsHelper("commitDescriptionWithPullRequestUrl", Helper { commit, options -> // This Handlebars helper returns an enriched commit description