diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5ea98c2f76a6d1334dc17cd39c21c6f127d49475..61b8c8f8970b40b8b2bfcd25ff5138c661d54499 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,10 +4,13 @@ stages: - update - build-debug - build-release + - release - deploy update: stage: update + except: + - tags script: - flutter packages get - flutter packages upgrade @@ -15,6 +18,8 @@ update: android:build-debug: stage: build-debug + except: + - tags script: # Flutter local configuration - echo flutter.sdk=$FLUTTER_PATH > android/local.properties @@ -42,6 +47,8 @@ android:build-release: stage: build-release only: - master + except: + - tags dependencies: - android:build-debug script: @@ -67,11 +74,34 @@ android:build-release: expire_in: 1 week interruptible: true -android:deploy: - stage: deploy +application:release: + stage: release + image: + name: alpine/git + entrypoint: [""] only: - master + except: + - tags dependencies: - android:build-release + script: + - git config user.email "${GITLAB_USER_EMAIL}" + - git config user.name "${GITLAB_USER_NAME}" + - git remote set-url origin https://oauth2:${GITLAB_ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH} + - VERSION_FILE="$(find . -name 'gradle.properties' | head -n1)" + - VERSION_NAME="$(grep '^app.versionName=' "${VERSION_FILE}" | cut -d'=' -f2)" + - VERSION_CODE="$(grep '^app.versionCode=' "${VERSION_FILE}" | cut -d'=' -f2)" + - TAG_NAME="Release_${VERSION_NAME}_${VERSION_CODE}" + - echo "${TAG_NAME}" + - git tag -a "${TAG_NAME}" -m "Release ${VERSION_NAME} (${VERSION_CODE})" + - git push origin "${TAG_NAME}" + +android:deploy: + stage: deploy + only: + - tags + dependencies: + - application:release script: - wget ${REPOSITORY_UPDATE_WEBHOOK}?token=${REPOSITORY_TOKEN} diff --git a/android/gradle.properties b/android/gradle.properties index 408253ceb04c0c7c49b3b9daf597f35b66ce16c1..e6443382b31fab5fc027b99dc079154f78f27d0b 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,5 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -app.versionName=0.0.27 -app.versionCode=27 +app.versionName=0.0.28 +app.versionCode=28