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

Skip build release if version already built

parent cd9f455d
No related branches found
No related tags found
1 merge request!8Resolve "Skip build / release if version is not changed"
Pipeline #1499 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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment