Skip to content
Snippets Groups Projects

Resolve "Put release tag on build step"

Merged Benoît Harrault requested to merge 7-put-release-tag-on-build-step into master
+ 26
9
image: cirrusci/flutter:latest
image: cirrusci/flutter:latest
stages:
stages:
- test
- update
- update
- build-debug
- build-debug
- build-release
- build-release
 
- release
- deploy
- deploy
tests:
stage: test
script:
- flutter test
interruptible: true
update:
update:
stage: update
stage: update
script:
script:
@@ -74,11 +68,34 @@ android:build-release:
@@ -74,11 +68,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_CODE}_${VERSION_NAME}"
 
- 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}
Loading