From b8a724613b3eeac0c6346ecd4130195819a896f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Harrault?= <benoit@harrault.fr> Date: Tue, 15 Oct 2024 10:16:40 +0200 Subject: [PATCH] Fix build process --- .gitlab-ci.yml | 6 +++++- android/app/build.gradle | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7856150..8b5def6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,9 @@ android:build-debug: - echo keyPassword=$ANDROID_DEBUG_KEY_PASSWORD >> android/key.properties # build flutter app - VERSION_NAME="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)" + - echo "${VERSION_NAME}" - VERSION_CODE="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f2)" + - echo "${VERSION_CODE}" - flutter packages get - flutter clean - flutter build apk --debug --split-per-abi @@ -57,6 +59,9 @@ android:build-release: - echo keyAlias=$ANDROID_KEY_ALIAS >> android/key.properties - echo keyPassword=$ANDROID_KEY_PASSWORD >> android/key.properties # build flutter app + - BASE_APK_FOLDER="build/app/outputs/flutter-apk" + - echo "${BASE_APK_FOLDER}" + - mkdir -p "${BASE_APK_FOLDER}" - VERSION_NAME="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)" - VERSION_CODE="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f2)" - TAG_NAME="Release_${VERSION_NAME}_${VERSION_CODE}" @@ -71,7 +76,6 @@ android:build-release: flutter build apk --release fi # prepare artifact - - BASE_APK_FOLDER="build/app/outputs/flutter-apk" - for APK in ${BASE_APK_FOLDER}/*.apk; do mv -v "${APK}" "$(echo "${APK}" | sed "s|\.apk|_${VERSION_CODE}.apk|")"; done - find "${BASE_APK_FOLDER}" -name "*.apk" # where are my apk? artifacts: diff --git a/android/app/build.gradle b/android/app/build.gradle index deeddea..57e585a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -30,7 +30,6 @@ android { targetSdk = flutter.targetSdkVersion versionCode = flutter.versionCode versionName = flutter.versionName - archivesBaseName = "$applicationId" + "_" + "$versionCode" } signingConfigs { -- GitLab