51 lines
1.4 KiB
Bash
Executable File
51 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if [[ -d ".git" ]]; then
|
|
|
|
echo "Must be called in project root"
|
|
exit 1
|
|
|
|
fi
|
|
|
|
VERS="$(cat pubspec.yaml | grep -oP '(?<=version: ).*' | sed 's/[\s]*//' | tr -d '\n' | tr -d '')"
|
|
|
|
VERS_BY_SPEC="$( echo -n "$VERS" | awk -F'+' '{print "v"$1}' )"
|
|
VERS_BY_TAG="$(git describe --abbrev=0 --tags)"
|
|
|
|
if [[ "$VERS_BY_TAG" != "$VERS_BY_SPEC" ]]; then
|
|
echo "Version in pubspec.yaml ($VERS_BY_SPEC) does not match latest git tag ($VERS_BY_TAG)"
|
|
exit 1
|
|
fi
|
|
|
|
echo ""
|
|
echo "(!) Make sure you've updated version-number in pubspec.yaml (current = ${VERS}) and created a tag (current = ${VERS_BY_TAG}) !"
|
|
echo '> Press Enter to confirm...' && read -r
|
|
echo ""
|
|
|
|
flutter build apk --release
|
|
cp build/app/outputs/flutter-apk/app-release.apk "_releases/v${VERS}.apk"
|
|
|
|
echo ""
|
|
echo "--> copied APK to _releases ( Version: ${VERS} )"
|
|
echo ""
|
|
|
|
flutter build appbundle --release
|
|
cp build/app/outputs/bundle/release/app-release.aab "_releases/v${VERS}.aab"
|
|
|
|
pushd "build/app/intermediates/merged_native_libs/release/out/lib" || exit 1
|
|
zip -r "../../../../../../../_releases/v${VERS}.symbols.zip" .
|
|
popd || exit 1
|
|
|
|
echo ""
|
|
echo "--> copied AAB to _releases ( Version: ${VERS} )"
|
|
echo ""
|
|
|
|
flutter build linux --release
|
|
tar -czf "_releases/v${VERS}.tar.gz" -C build/linux/x64/release/bundle .
|
|
|
|
echo ""
|
|
echo "--> copied linux-binary to _releases ( Version: ${VERS} )"
|
|
echo ""
|
|
echo "#=> file://$(pwd)/_releases"
|
|
echo ""
|
|
echo "Done." |