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

Merge branch '22-improve-ci-cd-create-tag-on-new-release-step' into 'master'

Resolve "Improve CI/CD, create tag on new release step"

Closes #22

See merge request !19
parents a693824e 5fac80f6
No related branches found
No related tags found
1 merge request!19Resolve "Improve CI/CD, create tag on new release step"
Pipeline #1515 canceled
image: cirrusci/flutter:latest
stages:
- test
- update
- build-debug
- build-release
- release
- deploy
tests:
stage: test
script:
- flutter test
interruptible: true
update:
stage: update
except:
- tags
script:
- flutter packages get
- flutter packages upgrade
......@@ -22,6 +18,8 @@ update:
android:build-debug:
stage: build-debug
except:
- tags
script:
# Flutter local configuration
- echo flutter.sdk=$FLUTTER_PATH > android/local.properties
......@@ -49,6 +47,8 @@ android:build-release:
stage: build-release
only:
- master
except:
- tags
dependencies:
- android:build-debug
script:
......@@ -74,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}
......@@ -2,5 +2,5 @@ org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
app.versionName=1.1.7
app.versionCode=7
app.versionName=1.1.8
app.versionCode=8
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment