fix: Format semver YY.MM.DDNN pour compatibilité Dart/Flutter

- Correction format version pour pubspec.yaml: YY.MM.DDNN
- VERSION file garde format lisible: 26.01.26.03
- pubspec.yaml reçoit format semver: 26.01.2603+26012603
- Concat DD+NN pour 3ème partie: 26+03 = 2603
- Build number complet: 26012603

Résout erreur: Could not parse '26.01.26.03+26012603'

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-01-26 12:30:40 +01:00
parent 097335193e
commit eef1fc8d32

View File

@@ -169,6 +169,9 @@ if [ "$SOURCE_TYPE" = "local_build" ]; then
# Date du jour au format YY.MM.DD
TODAY=$(date +%y.%m.%d)
TODAY_YY=$(date +%y)
TODAY_MM=$(date +%m)
TODAY_DD=$(date +%d)
if [ -f ../VERSION ]; then
CURRENT_VERSION=$(cat ../VERSION | tr -d '\n\r' | tr -d ' ')
@@ -199,15 +202,20 @@ if [ "$SOURCE_TYPE" = "local_build" ]; then
echo_warning "VERSION file not found, creating new one"
fi
# Construire la nouvelle version complète
# Construire la version complète YY.MM.DD.NN pour le fichier VERSION
VERSION="${TODAY}.${NEW_BUILD}"
echo "$VERSION" > ../VERSION
echo_success "✅ New version: $VERSION"
# Génération du build number et mise à jour du pubspec.yaml
BUILD_NUMBER=$(echo $VERSION | tr -d '.')
FULL_VERSION="${VERSION}+${BUILD_NUMBER}"
echo_info "Full version for pubspec.yaml: $FULL_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}"
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"