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

Add automatic tag creation on release CI step

parent a15bfa3a
No related branches found
No related tags found
No related merge requests found
Pipeline #1431 failed
...@@ -5,6 +5,7 @@ stages: ...@@ -5,6 +5,7 @@ stages:
- update - update
- build-debug - build-debug
- build-release - build-release
- release
- deploy - deploy
tests: tests:
...@@ -47,8 +48,8 @@ android:build-debug: ...@@ -47,8 +48,8 @@ android:build-debug:
android:build-release: android:build-release:
stage: build-release stage: build-release
only: # only:
- master # - master
dependencies: dependencies:
- android:build-debug - android:build-debug
script: script:
...@@ -74,11 +75,31 @@ android:build-release: ...@@ -74,11 +75,31 @@ android:build-release:
expire_in: 1 week expire_in: 1 week
interruptible: true interruptible: true
application:release:
stage: release
image:
name: alpine/git
# only:
# - master
dependencies:
- android:build-release
script:
- git config user.email "${GITLAB_USER_EMAIL}"
- git config user.name "${GITLAB_USER_NAME}"
- git remote add release-tag-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 "Release_$(date +%Y-%m-%d)" -m "Auto-Release"
# - git push release-tag-origin "Release_$(date +%Y-%m-%d)"
android:deploy: android:deploy:
stage: deploy stage: deploy
only: only:
- master - tags
dependencies: dependencies:
- android:build-release - 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=1.0.1 app.versionName=1.0.2
app.versionCode=2 app.versionCode=3
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment