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
+ 22
21
image: cirrusci/flutter:latest
stages:
- update
# - update
- build-debug
- build-release
- release
- deploy
update:
stage: update
script:
- flutter packages get
- flutter packages upgrade
interruptible: true
# update:
# stage: update
# script:
# - flutter packages get
# - flutter packages upgrade
# interruptible: true
android:build-debug:
stage: build-debug
@@ -33,11 +33,11 @@ android:build-debug:
# - flutter build apk --debug
# # prepare artifact
- find . -name "*.apk" # where is my apk?
artifacts:
paths:
- build/app/outputs/apk/debug
expire_in: 1 week
interruptible: true
# artifacts:
# paths:
# - build/app/outputs/apk/debug
# expire_in: 1 week
# interruptible: true
android:build-release:
stage: build-release
@@ -62,16 +62,17 @@ android:build-release:
# - flutter build apk --release
# # prepare artifact
- find . -name "*.apk" # where is my apk?
artifacts:
paths:
- build/app/outputs/apk/release
expire_in: 1 week
interruptible: true
# artifacts:
# paths:
# - build/app/outputs/apk/release
# expire_in: 1 week
# interruptible: true
application:release:
stage: release
image:
name: alpine/git
entrypoint: [""]
# only:
# - master
dependencies:
@@ -79,14 +80,14 @@ application: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}
- 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}"
- TAG_NAME="Release_${VERSION_CODE}_${VERSION_NAME}"
- echo "${TAG_NAME}"
# - git tag -a "Release_$(date +%Y-%m-%d)" -m "Auto-Release ${}"
# - git push release-tag-origin "Release_$(date +%Y-%m-%d)"
- git tag -a "Release_${TAG_NAME}" -m "Auto-Release ${VERSION_NAME} (${VERSION_CODE})"
- git push origin "Release_${TAG_NAME}"
android:deploy:
stage: deploy
Loading