diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 96d167d..37c2568 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,7 @@ name: Release Tauri App on: push: tags: - # Accepte les tags en minuscule (v1.1.0) comme en majuscule (V1.1.0), - # pour éviter qu'une faute de casse empêche le déclenchement du build. + # Accept lowercase and uppercase tags, for example v1.1.0.0 or V1.1.0.0. - 'v*' - 'V*' workflow_dispatch: @@ -41,22 +40,37 @@ jobs: cd widget npm install - - name: Update version in tauri.conf.json + - name: Update app version from tag shell: bash run: | - # Retire un préfixe v/V puis ne garde que les 3 premiers segments - # (ex. "V1.1.0.0" -> "1.1.0") afin de produire une version semver valide. - TAG_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^[vV]//' | cut -d. -f1-3) - if [[ ! "$TAG_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - TAG_VERSION="1.0.0" + # Keep Tauri/Cargo on valid SemVer while allowing release tags like V1.1.0.0. + RAW_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^[vV]//') + APP_VERSION="1.1.0" + if [[ "$RAW_VERSION" =~ ^([0-9]+\.[0-9]+\.[0-9]+)(\.[0-9]+)?$ ]]; then + APP_VERSION="${BASH_REMATCH[1]}" fi - echo "Updating tauri.conf.json version to $TAG_VERSION" + echo "Updating app version to $APP_VERSION" node -e " const fs = require('fs'); - const file = './widget/src-tauri/tauri.conf.json'; - const config = JSON.parse(fs.readFileSync(file, 'utf8')); - config.package.version = '$TAG_VERSION'; - fs.writeFileSync(file, JSON.stringify(config, null, 2), 'utf8'); + + const updateJson = (file, update) => { + const data = JSON.parse(fs.readFileSync(file, 'utf8')); + update(data); + fs.writeFileSync(file, JSON.stringify(data, null, 2) + '\n', 'utf8'); + }; + + updateJson('./widget/package.json', (pkg) => { + pkg.version = '$APP_VERSION'; + }); + + updateJson('./widget/src-tauri/tauri.conf.json', (config) => { + config.package.version = '$APP_VERSION'; + }); + + const cargoFile = './widget/src-tauri/Cargo.toml'; + const cargo = fs.readFileSync(cargoFile, 'utf8') + .replace(/^version = \".*\"$/m, 'version = \"$APP_VERSION\"'); + fs.writeFileSync(cargoFile, cargo, 'utf8'); " - name: Build the Tauri app @@ -69,9 +83,7 @@ jobs: releaseBody: | Installeur Windows de TodoFlow ${{ github.ref_name }}. - Téléchargez le fichier `.exe` (NSIS) ou `.msi` ci-dessous pour installer l'application. - # Publier directement la release (et non en brouillon) afin qu'elle soit visible - # publiquement et marquée automatiquement comme "Latest" sur la page GitHub. + Telechargez le fichier `.exe` (NSIS) ou `.msi` ci-dessous pour installer l'application. releaseDraft: false prerelease: false projectPath: './widget' diff --git a/server/app/main.py b/server/app/main.py index 976f4da..b4cafce 100644 --- a/server/app/main.py +++ b/server/app/main.py @@ -43,7 +43,7 @@ async def lifespan(app: FastAPI): app = FastAPI( title="TodoFlow API", description="API centralisée pour la Todo list, connectée au widget de bureau et pilotable par Agent IA.", - version="1.0.0", + version="1.1.0", lifespan=lifespan )