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
+15
View File
@@ -0,0 +1,15 @@
class AppVersion {
const AppVersion._();
static const String version = String.fromEnvironment(
'APP_VERSION',
defaultValue: '1.1.0',
);
static const String buildNumber = String.fromEnvironment(
'APP_BUILD_NUMBER',
defaultValue: '2',
);
static const String display = 'Version $version (Build $buildNumber)';
}
+18
View File
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../config/app_version.dart';
import '../controller/login_controller.dart'; import '../controller/login_controller.dart';
import '../widgets/my_login_widget.dart'; import '../widgets/my_login_widget.dart';
@@ -14,6 +15,23 @@ class LoginPage extends GetView<LoginController> {
var displayHeight = MediaQuery.of(context).size.height; var displayHeight = MediaQuery.of(context).size.height;
return SafeArea( return SafeArea(
child: Scaffold( child: Scaffold(
bottomNavigationBar: Container(
alignment: Alignment.center,
color: Colors.blue.shade100,
height: 36,
child: Tooltip(
message: 'SemVer: ${AppVersion.version}+${AppVersion.buildNumber}',
child: Text(
AppVersion.display,
style: TextStyle(
color: Colors.blueGrey.shade700,
fontSize: 13,
fontWeight: FontWeight.w600,
letterSpacing: 0.3,
),
),
),
),
body: Container( body: Container(
height: displayHeight, height: displayHeight,
width: displayWidth, width: displayWidth,
+1 -1
View File
@@ -3,7 +3,7 @@ description: "A new Flutter project."
publish_to: "none" publish_to: "none"
version: 1.0.0+1 version: 1.1.0+2
environment: environment:
sdk: ^3.10.7 sdk: ^3.10.7
+28 -4
View File
@@ -13,12 +13,33 @@ SERVER_PATH="/root/webserver"
echo "🚀 Starting Flutter Web App Update..." echo "🚀 Starting Flutter Web App Update..."
echo "================================================" echo "================================================"
# Step 1: Build Flutter Web # Step 1: Buildnummer nach Flutter-/SemVer-Konvention erhoehen
echo "📦 Building Flutter web release..." # Die SemVer-Version (MAJOR.MINOR.PATCH) wird bei fachlichen Releases manuell
flutter build web --release --no-wasm-dry-run # 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 "❌ Build failed!"
echo " Version restored to $CURRENT_APP_VERSION"
exit 1 exit 1
fi fi
@@ -61,4 +82,7 @@ echo "✅ Update complete!"
echo "================================================" echo "================================================"
echo "Your app should now be updated at:" echo "Your app should now be updated at:"
echo " http://tank.joshihomeserver.ipv64.net" 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 "================================================" echo "================================================"
+1 -1
View File
@@ -42,6 +42,6 @@ _flutter.buildConfig = {"engineRevision":"af7e796e161ae0bb1ff0758c71a7105418bd9d
_flutter.loader.load({ _flutter.loader.load({
serviceWorkerSettings: { serviceWorkerSettings: {
serviceWorkerVersion: "2476194018" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */ serviceWorkerVersion: "2875783503" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
} }
}); });
+8286 -8283
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"app_name":"flutter_tank_web_app","version":"1.0.0","build_number":"1","package_name":"flutter_tank_web_app"} {"app_name":"flutter_tank_web_app","version":"1.1.0","build_number":"2","package_name":"flutter_tank_web_app"}