From 7345cf805e5948ce2f460264f880af2a2d3724fc Mon Sep 17 00:00:00 2001 From: Pierre Date: Mon, 26 Jan 2026 12:35:09 +0100 Subject: [PATCH] fix: Correction format version YY.MM.DDNN (3 parties au lieu de 4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - VERSION file stocke maintenant: 26.01.2604 (3 parties) - Au lieu de: 26.01.26.04 (4 parties - invalide pour semver) - Regex ajustée pour parser le nouveau format: ^YY.MM.DDNN$ - Détection changement de date compare YY, MM, DD séparément - Build number reste YYMMDDNN (26012604) - Commentaires mis à jour pour refléter format YY.MM.DDNN Résout: "Could not parse 26.01.26.04+26012604" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- app/deploy-app.sh | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/app/deploy-app.sh b/app/deploy-app.sh index 54f14f5d..de6e03e6 100755 --- a/app/deploy-app.sh +++ b/app/deploy-app.sh @@ -164,10 +164,10 @@ if [ "$SOURCE_TYPE" = "local_build" ]; then fi source .env-deploy-dev - # Système automatique de versioning YY.MM.DD.NN - echo_info "Managing version (automatic YY.MM.DD.NN)..." + # Système automatique de versioning YY.MM.DDNN + echo_info "Managing version (automatic YY.MM.DDNN)..." - # Date du jour au format YY.MM.DD + # Date du jour TODAY=$(date +%y.%m.%d) TODAY_YY=$(date +%y) TODAY_MM=$(date +%m) @@ -177,15 +177,17 @@ if [ "$SOURCE_TYPE" = "local_build" ]; then CURRENT_VERSION=$(cat ../VERSION | tr -d '\n\r' | tr -d ' ') echo_info "Current version: $CURRENT_VERSION" - # Extraire la partie date et le build number - if [[ $CURRENT_VERSION =~ ^([0-9]{2}\.[0-9]{2}\.[0-9]{2})\.([0-9]{2})$ ]]; then - VERSION_DATE="${BASH_REMATCH[1]}" - BUILD_NUM="${BASH_REMATCH[2]}" + # Extraire la partie date et le build number (format: YY.MM.DDNN) + if [[ $CURRENT_VERSION =~ ^([0-9]{2})\.([0-9]{2})\.([0-9]{2})([0-9]{2})$ ]]; then + PREV_YY="${BASH_REMATCH[1]}" + PREV_MM="${BASH_REMATCH[2]}" + PREV_DD="${BASH_REMATCH[3]}" + BUILD_NUM="${BASH_REMATCH[4]}" - # Si la date a changé, reset à .01 - if [ "$VERSION_DATE" != "$TODAY" ]; then + # Si la date a changé, reset à 01 + if [ "$PREV_YY" != "$TODAY_YY" ] || [ "$PREV_MM" != "$TODAY_MM" ] || [ "$PREV_DD" != "$TODAY_DD" ]; then NEW_BUILD="01" - echo_info "Date changed: $VERSION_DATE → $TODAY, resetting build to 01" + echo_info "Date changed: $PREV_YY.$PREV_MM.$PREV_DD → $TODAY_YY.$TODAY_MM.$TODAY_DD, resetting build to 01" else # Incrémenter le build number NEW_BUILD=$(printf "%02d" $((10#$BUILD_NUM + 1))) @@ -202,19 +204,16 @@ if [ "$SOURCE_TYPE" = "local_build" ]; then echo_warning "VERSION file not found, creating new one" fi - # Construire la version complète YY.MM.DD.NN pour le fichier VERSION - VERSION="${TODAY}.${NEW_BUILD}" + # Construire la version semver: YY.MM.DDNN (3 parties) + VERSION="${TODAY_YY}.${TODAY_MM}.${TODAY_DD}${NEW_BUILD}" echo "$VERSION" > ../VERSION echo_success "✅ New version: $VERSION" - # Version semver compatible: YY.MM.DDNN (3 parties) - SEMVER_VERSION="${TODAY_YY}.${TODAY_MM}.${TODAY_DD}${NEW_BUILD}" - # Build number: YYMMDDNN (tous les chiffres) BUILD_NUMBER="${TODAY_YY}${TODAY_MM}${TODAY_DD}${NEW_BUILD}" # Version complète pour pubspec.yaml - FULL_VERSION="${SEMVER_VERSION}+${BUILD_NUMBER}" + FULL_VERSION="${VERSION}+${BUILD_NUMBER}" echo_info "Semver version for pubspec.yaml: $FULL_VERSION" sed -i "s/^version: .*/version: $FULL_VERSION/" pubspec.yaml || echo_error "Failed to update pubspec.yaml" @@ -274,13 +273,13 @@ cat > lib/core/services/app_info_service.dart < 'v\$version+\$buildNumber'; // Application name