Skip to content
Snippets Groups Projects

Resolve "Skip build / release if version is not changed"

1 file
+ 13
3
Compare changes
  • Side-by-side
  • Inline
+ 13
3
@@ -63,9 +63,19 @@ android:build-release:
@@ -63,9 +63,19 @@ android:build-release:
- echo keyAlias=$ANDROID_KEY_ALIAS >> android/key.properties
- echo keyAlias=$ANDROID_KEY_ALIAS >> android/key.properties
- echo keyPassword=$ANDROID_KEY_PASSWORD >> android/key.properties
- echo keyPassword=$ANDROID_KEY_PASSWORD >> android/key.properties
# build flutter app
# build flutter app
- flutter packages get
- VERSION_FILE="$(find . -name 'gradle.properties' | head -n1)"
- flutter clean
- VERSION_NAME="$(grep '^app.versionName=' "${VERSION_FILE}" | cut -d'=' -f2)"
- flutter build apk --release
- 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
# prepare artifact
- find . -name "*.apk" # where is my apk?
- find . -name "*.apk" # where is my apk?
artifacts:
artifacts:
Loading