diff --git a/.github/actions/app-distribution/action.yml b/.github/actions/app-distribution/action.yml index eb1870425..4783a1e10 100644 --- a/.github/actions/app-distribution/action.yml +++ b/.github/actions/app-distribution/action.yml @@ -31,7 +31,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 -PappDistributionGitTagPrefix=${{ inputs.git-tag-prefix }} -PappDistributionGroup=${{ inputs.group }} -PappDistributionGitTagSha=$COMMIT_SHA --stacktrace + ./gradlew app:appDistributionUpload -PversionNameSuffix=$VERSION_NAME_SUFFIX -PversionCode=$GITHUB_RUN_NUMBER -PappDistributionVariants=qualifRelease -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/android-build.yml b/.github/workflows/android-build.yml index 41372706b..6fe625bd0 100644 --- a/.github/workflows/android-build.yml +++ b/.github/workflows/android-build.yml @@ -52,7 +52,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: app - path: app/build/outputs/apk/*/*.apk + path: app/build/outputs/apk/*/*/*.apk - name: Store lib artifacts uses: actions/upload-artifact@v3 @@ -168,12 +168,12 @@ jobs: - name: Publish release to Google Play Store run: | ./gradlew assembleRelease bundleRelease - curl -F 'file=@app/build/outputs/bundle/release/app-release.aab' https://oma-portal.orange.fr/oma/api/v1/external/applications/${{ secrets.OMA_APP_ID }}/artifacts -H "apiKey:${{ secrets.OMA_APP_TOKEN }}" + curl -F 'file=@app/build/outputs/bundle/prodRelease/app-prod-release.aab' https://oma-portal.orange.fr/oma/api/v1/external/applications/${{ secrets.OMA_APP_ID }}/artifacts -H "apiKey:${{ secrets.OMA_APP_TOKEN }}" - name: Store Google Play Store artifacts uses: actions/upload-artifact@v3 with: name: google-play-store path: | - app/build/outputs/apk/*/*.apk + app/build/outputs/apk/*/*/*.apk app/build/outputs/bundle/*/*.aab diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6d7a5da08..3d36b5963 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -32,7 +32,6 @@ android { compileSdk = Versions.compileSdk defaultConfig { - applicationId = "com.orange.ods.app" minSdk = Versions.minSdk targetSdk = Versions.targetSdk val versionCodeProperty = project.findTypedProperty("versionCode") @@ -76,6 +75,20 @@ android { } } + val versionFlavorDimension = "version" + flavorDimensions.add(versionFlavorDimension) + productFlavors { + create("qualif") { + dimension = versionFlavorDimension + applicationId = "com.orange.ods.test.app" + } + + create("prod") { + dimension = versionFlavorDimension + applicationId = "com.orange.ods.app" + } + } + firebaseAppDistribution { releaseNotesFile = Firebase_gradle.AppDistribution.releaseNotesFilePath groups = project.findTypedProperty("appDistributionGroup") diff --git a/app/google-services.json b/app/google-services.json index d1d0cef61..dffac0317 100644 --- a/app/google-services.json +++ b/app/google-services.json @@ -62,6 +62,64 @@ ] } } + }, + { + "client_info": { + "mobilesdk_app_id": "1:212698857200:android:67d1403d02a72f4d5ecc35", + "android_client_info": { + "package_name": "com.orange.ods.test.app" + } + }, + "oauth_client": [ + { + "client_id": "212698857200-mvqaopuseqhqeaglk7jm0g8qg0dcvsab.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyAIY6bMaglXBkcA72v_vja3yI6-7uaR-8U" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "212698857200-mvqaopuseqhqeaglk7jm0g8qg0dcvsab.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:212698857200:android:92978ae61c91c8b85ecc35", + "android_client_info": { + "package_name": "com.orange.ods.test.flutterapp" + } + }, + "oauth_client": [ + { + "client_id": "212698857200-mvqaopuseqhqeaglk7jm0g8qg0dcvsab.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyAIY6bMaglXBkcA72v_vja3yI6-7uaR-8U" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "212698857200-mvqaopuseqhqeaglk7jm0g8qg0dcvsab.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } } ], "configuration_version": "1" diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/prod/res/drawable/ic_launcher_foreground.xml similarity index 100% rename from app/src/main/res/drawable/ic_launcher_foreground.xml rename to app/src/prod/res/drawable/ic_launcher_foreground.xml diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/prod/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to app/src/prod/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/prod/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to app/src/prod/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/prod/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from app/src/main/res/mipmap-hdpi/ic_launcher.png rename to app/src/prod/res/mipmap-hdpi/ic_launcher.png diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/prod/res/mipmap-hdpi/ic_launcher_round.png similarity index 100% rename from app/src/main/res/mipmap-hdpi/ic_launcher_round.png rename to app/src/prod/res/mipmap-hdpi/ic_launcher_round.png diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/prod/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from app/src/main/res/mipmap-mdpi/ic_launcher.png rename to app/src/prod/res/mipmap-mdpi/ic_launcher.png diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/prod/res/mipmap-mdpi/ic_launcher_round.png similarity index 100% rename from app/src/main/res/mipmap-mdpi/ic_launcher_round.png rename to app/src/prod/res/mipmap-mdpi/ic_launcher_round.png diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/prod/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to app/src/prod/res/mipmap-xhdpi/ic_launcher.png diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/prod/res/mipmap-xhdpi/ic_launcher_round.png similarity index 100% rename from app/src/main/res/mipmap-xhdpi/ic_launcher_round.png rename to app/src/prod/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/prod/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to app/src/prod/res/mipmap-xxhdpi/ic_launcher.png diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/prod/res/mipmap-xxhdpi/ic_launcher_round.png similarity index 100% rename from app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png rename to app/src/prod/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/prod/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to app/src/prod/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/prod/res/mipmap-xxxhdpi/ic_launcher_round.png similarity index 100% rename from app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png rename to app/src/prod/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/app/src/main/res/values/ic_launcher_background.xml b/app/src/prod/res/values/ic_launcher_background.xml similarity index 100% rename from app/src/main/res/values/ic_launcher_background.xml rename to app/src/prod/res/values/ic_launcher_background.xml diff --git a/app/src/qualif/res/drawable-hdpi/ic_launcher_foreground.png b/app/src/qualif/res/drawable-hdpi/ic_launcher_foreground.png new file mode 100644 index 000000000..1218b395a Binary files /dev/null and b/app/src/qualif/res/drawable-hdpi/ic_launcher_foreground.png differ diff --git a/app/src/qualif/res/drawable-xhdpi/ic_launcher_foreground.png b/app/src/qualif/res/drawable-xhdpi/ic_launcher_foreground.png new file mode 100644 index 000000000..2b36dc43f Binary files /dev/null and b/app/src/qualif/res/drawable-xhdpi/ic_launcher_foreground.png differ diff --git a/app/src/qualif/res/drawable-xxhdpi/ic_launcher_foreground.png b/app/src/qualif/res/drawable-xxhdpi/ic_launcher_foreground.png new file mode 100644 index 000000000..6d96e7383 Binary files /dev/null and b/app/src/qualif/res/drawable-xxhdpi/ic_launcher_foreground.png differ diff --git a/app/src/qualif/res/drawable-xxxhdpi/ic_launcher_foreground.png b/app/src/qualif/res/drawable-xxxhdpi/ic_launcher_foreground.png new file mode 100644 index 000000000..ece2731b0 Binary files /dev/null and b/app/src/qualif/res/drawable-xxxhdpi/ic_launcher_foreground.png differ diff --git a/app/src/qualif/res/mipmap-hdpi/ic_launcher.png b/app/src/qualif/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..d5c7b9b85 Binary files /dev/null and b/app/src/qualif/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/qualif/res/mipmap-hdpi/ic_launcher_round.png b/app/src/qualif/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 000000000..bf5d3fc98 Binary files /dev/null and b/app/src/qualif/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/app/src/qualif/res/mipmap-xhdpi/ic_launcher.png b/app/src/qualif/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..f79fa611a Binary files /dev/null and b/app/src/qualif/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/qualif/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/qualif/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 000000000..9c3ce0fc0 Binary files /dev/null and b/app/src/qualif/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/app/src/qualif/res/mipmap-xxhdpi/ic_launcher.png b/app/src/qualif/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..7616ebc4c Binary files /dev/null and b/app/src/qualif/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/qualif/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/qualif/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 000000000..f4380dc3b Binary files /dev/null and b/app/src/qualif/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/app/src/qualif/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/qualif/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..a4d6fb622 Binary files /dev/null and b/app/src/qualif/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/qualif/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/qualif/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 000000000..5131084cc Binary files /dev/null and b/app/src/qualif/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/buildSrc/src/main/kotlin/com/orange/ods/gradle/MavenCentralPublishPluginExtension.kt b/buildSrc/src/main/kotlin/com/orange/ods/gradle/MavenCentralPublishPluginExtension.kt index d798f1c44..bd2413c54 100644 --- a/buildSrc/src/main/kotlin/com/orange/ods/gradle/MavenCentralPublishPluginExtension.kt +++ b/buildSrc/src/main/kotlin/com/orange/ods/gradle/MavenCentralPublishPluginExtension.kt @@ -14,7 +14,7 @@ abstract class MavenCentralPublishPluginExtension { companion object { const val NAME = "mavenCentralPublish" - const val RELEASE_COMPONENT_NAME = "release" + const val VARIANT = "prodRelease" } var artifactId: String? = null diff --git a/buildSrc/src/main/kotlin/library.gradle.kts b/buildSrc/src/main/kotlin/library.gradle.kts index 460844f93..fb1b6c91b 100644 --- a/buildSrc/src/main/kotlin/library.gradle.kts +++ b/buildSrc/src/main/kotlin/library.gradle.kts @@ -44,7 +44,7 @@ android { } publishing { - singleVariant(MavenCentralPublishPluginExtension.RELEASE_COMPONENT_NAME) { + singleVariant(MavenCentralPublishPluginExtension.VARIANT) { withSourcesJar() withJavadocJar() } diff --git a/buildSrc/src/main/kotlin/maven-central-publish.gradle.kts b/buildSrc/src/main/kotlin/maven-central-publish.gradle.kts index fdf45facb..d033d1526 100644 --- a/buildSrc/src/main/kotlin/maven-central-publish.gradle.kts +++ b/buildSrc/src/main/kotlin/maven-central-publish.gradle.kts @@ -29,8 +29,8 @@ apply { afterEvaluate { publishing { publications { - create(MavenCentralPublishPluginExtension.RELEASE_COMPONENT_NAME) { - from(components[MavenCentralPublishPluginExtension.RELEASE_COMPONENT_NAME]) + create(MavenCentralPublishPluginExtension.VARIANT) { + from(components["release"]) groupId = "com.orange.ods.android" artifactId = pluginExtension?.artifactId ?: "ods-${project.name}" this.version = version @@ -86,6 +86,6 @@ afterEvaluate { "GNUPG_SIGNING_PASSWORD" ) useInMemoryPgpKeys(signingKeyId, signingSecretKey, signingPassword) - sign(publishing.publications[MavenCentralPublishPluginExtension.RELEASE_COMPONENT_NAME]) + sign(publishing.publications[MavenCentralPublishPluginExtension.VARIANT]) } }