Skip to content
Snippets Groups Projects
Commit 60f65fb0 authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Improve CI/CD, create tag on new release step

parent 7883afdc
No related branches found
No related tags found
1 merge request!29Resolve "Improve CI/CD, create tag on new release step"
Pipeline #1465 passed
...@@ -4,10 +4,13 @@ stages: ...@@ -4,10 +4,13 @@ stages:
- update - update
- build-debug - build-debug
- build-release - build-release
- release
- deploy - deploy
update: update:
stage: update stage: update
except:
- tags
script: script:
- flutter packages get - flutter packages get
- flutter packages upgrade - flutter packages upgrade
...@@ -15,6 +18,8 @@ update: ...@@ -15,6 +18,8 @@ update:
android:build-debug: android:build-debug:
stage: build-debug stage: build-debug
except:
- tags
script: script:
# Flutter local configuration # Flutter local configuration
- echo flutter.sdk=$FLUTTER_PATH > android/local.properties - echo flutter.sdk=$FLUTTER_PATH > android/local.properties
...@@ -42,6 +47,8 @@ android:build-release: ...@@ -42,6 +47,8 @@ android:build-release:
stage: build-release stage: build-release
only: only:
- master - master
except:
- tags
dependencies: dependencies:
- android:build-debug - android:build-debug
script: script:
...@@ -67,11 +74,34 @@ android:build-release: ...@@ -67,11 +74,34 @@ android:build-release:
expire_in: 1 week expire_in: 1 week
interruptible: true interruptible: true
android:deploy: application:release:
stage: deploy stage: release
image:
name: alpine/git
entrypoint: [""]
only: only:
- master - master
except:
- tags
dependencies: dependencies:
- android:build-release - 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: script:
- wget ${REPOSITORY_UPDATE_WEBHOOK}?token=${REPOSITORY_TOKEN} - wget ${REPOSITORY_UPDATE_WEBHOOK}?token=${REPOSITORY_TOKEN}
org.gradle.jvmargs=-Xmx1536M org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
app.versionName=0.0.27 app.versionName=0.0.28
app.versionCode=27 app.versionCode=28
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment