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

Merge branch '8-improve-ci-cd-fix-release-skip-jobs' into 'master'

Resolve "Improve CI/CD, fix release, skip jobs"

Closes #8

See merge request !8
parents 0b58f086 9e41614a
No related branches found
No related tags found
1 merge request!8Resolve "Improve CI/CD, fix release, skip jobs"
Pipeline #1608 passed
......@@ -63,9 +63,19 @@ android:build-release:
- echo keyAlias=$ANDROID_KEY_ALIAS >> android/key.properties
- echo keyPassword=$ANDROID_KEY_PASSWORD >> android/key.properties
# build flutter app
- flutter packages get
- flutter clean
- flutter build apk --release
- 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}"
- >
if [ $(git tag -l "${TAG_NAME}") ]; then
echo "Tag ${TAG_NAME} already exists. Skipping build release."
else
flutter packages get
flutter clean
flutter build apk --release
fi
# prepare artifact
- find . -name "*.apk" # where is my apk?
artifacts:
......@@ -94,8 +104,13 @@ application:release:
- 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}"
- >
if [ $(git tag -l "${TAG_NAME}") ]; then
echo "Tag ${TAG_NAME} already exists. Skipping release and tag creation."
else
git tag -a "${TAG_NAME}" -m "Release ${VERSION_NAME} (${VERSION_CODE})"
git push origin "${TAG_NAME}"
fi
android:deploy:
stage: deploy
......@@ -104,4 +119,4 @@ android:deploy:
dependencies:
- application:release
script:
- wget ${REPOSITORY_UPDATE_WEBHOOK}?token=${REPOSITORY_TOKEN}
- curl "${REPOSITORY_UPDATE_WEBHOOK}?token=${REPOSITORY_TOKEN}"
......@@ -2,5 +2,5 @@ org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
app.versionName=1.0.5
app.versionCode=6
app.versionName=1.0.6
app.versionCode=7
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment