Version of app integration

This commit is contained in:
2026-10-09 19:35:51 +02:00
parent 832747fce6
commit bbb4edfec6
7 changed files with 8350 additions and 8290 deletions
+28 -4
View File
@@ -13,12 +13,33 @@ SERVER_PATH="/root/webserver"
echo "🚀 Starting Flutter Web App Update..."
echo "================================================"
# Step 1: Build Flutter Web
echo "📦 Building Flutter web release..."
flutter build web --release --no-wasm-dry-run
# Step 1: Buildnummer nach Flutter-/SemVer-Konvention erhoehen
# Die SemVer-Version (MAJOR.MINOR.PATCH) wird bei fachlichen Releases manuell
# in pubspec.yaml gepflegt. Jeder Deployment-Build erhaelt eine neue BUILD-Nr.
CURRENT_APP_VERSION=$(sed -n 's/^version:[[:space:]]*//p' pubspec.yaml | head -n 1)
if [ $? -ne 0 ]; then
if [[ ! "$CURRENT_APP_VERSION" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)\+([0-9]+)$ ]]; then
echo "❌ Invalid version in pubspec.yaml: $CURRENT_APP_VERSION"
echo " Expected format: MAJOR.MINOR.PATCH+BUILD (for example 1.1.0+2)"
exit 1
fi
SEMVER="${CURRENT_APP_VERSION%%+*}"
CURRENT_BUILD_NUMBER="${CURRENT_APP_VERSION##*+}"
NEXT_BUILD_NUMBER=$((10#$CURRENT_BUILD_NUMBER + 1))
NEXT_APP_VERSION="$SEMVER+$NEXT_BUILD_NUMBER"
sed -i "s/^version:.*/version: $NEXT_APP_VERSION/" pubspec.yaml
echo "🏷️ Version: $CURRENT_APP_VERSION -> $NEXT_APP_VERSION"
echo "📦 Building Flutter web release..."
if ! flutter build web --release --no-wasm-dry-run \
--dart-define="APP_VERSION=$SEMVER" \
--dart-define="APP_BUILD_NUMBER=$NEXT_BUILD_NUMBER"; then
sed -i "s/^version:.*/version: $CURRENT_APP_VERSION/" pubspec.yaml
echo "❌ Build failed!"
echo " Version restored to $CURRENT_APP_VERSION"
exit 1
fi
@@ -61,4 +82,7 @@ echo "✅ Update complete!"
echo "================================================"
echo "Your app should now be updated at:"
echo " http://tank.joshihomeserver.ipv64.net"
echo "Deployed version: $NEXT_APP_VERSION"
echo "The login page must show: Version $SEMVER (Build $NEXT_BUILD_NUMBER)"
echo "If another version is shown, refresh the browser with Ctrl+F5."
echo "================================================"