Compare commits

2 Commits

3 changed files with 19 additions and 109 deletions

View File

@ -1,43 +0,0 @@
name: Build Windows
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build-windows:
runs-on: windows-latest
steps:
- name: Checkout du code
uses: actions/checkout@v4
- name: Installer Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
cache: 'npm'
- name: Installer Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Installer les dépendances npm
run: npm ci
- name: Build Tauri
run: npm run tauri build
- name: Upload des artefacts
uses: actions/upload-artifact@v4
with:
name: windows-build
path: |
src-tauri/target/release/bundle/msi/*.msi
src-tauri/target/release/bundle/nsis/*.exe

View File

@ -1,9 +1,12 @@
name: Build Linux
name: Build & Release
on:
push:
branches:
- '**' # toutes les branches
tags:
- 'v*'
pull_request:
workflow_dispatch:
jobs:
@ -16,8 +19,6 @@ jobs:
name: 'windows'
- platform: 'ubuntu-22.04'
name: 'linux'
# - platform: 'macos-latest' # si un jour tu veux macOS
# name: 'macos'
runs-on: ${{ matrix.platform }}
@ -51,7 +52,7 @@ jobs:
run: npm run tauri build
- name: Upload Windows artifacts
if: matrix.platform == 'windows-latest'
if: matrix.platform == 'windows-latest' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
uses: actions/upload-artifact@v4
with:
name: windows-build
@ -60,7 +61,7 @@ jobs:
src-tauri/target/release/bundle/nsis/*.exe
- name: Upload Linux artifacts
if: matrix.platform == 'ubuntu-22.04'
if: matrix.platform == 'ubuntu-22.04' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
uses: actions/upload-artifact@v4
with:
name: linux-build
@ -68,3 +69,16 @@ jobs:
src-tauri/target/release/bundle/deb/*.deb
src-tauri/target/release/bundle/rpm/*.rpm
src-tauri/target/release/bundle/appimage/*.AppImage
release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Télécharger les artefacts Windows
uses: actions/download-artifact@v4
with:
name: w

View File

@ -1,61 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
VERSION="${1:-}"
if [[ -z "$VERSION" ]]; then
CURRENT=$(python3 -c "import json; print(json.load(open('src-tauri/tauri.conf.json'))['version'])")
echo "Version actuelle : $CURRENT"
read -rp "Nouvelle version (ex: 1.0.0) : " VERSION
fi
# Retire un éventuel 'v' préfixé
VERSION="${VERSION#v}"
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Erreur : version invalide '$VERSION' (format attendu : X.Y.Z)"
exit 1
fi
echo "→ Mise à jour de la version vers $VERSION"
# Mise à jour tauri.conf.json
python3 - "$VERSION" << 'EOF'
import json, sys
v = sys.argv[1]
path = "src-tauri/tauri.conf.json"
with open(path) as f:
data = json.load(f)
data["version"] = v
with open(path, "w") as f:
json.dump(data, f, indent=2, ensure_ascii=False)
f.write("\n")
EOF
# Mise à jour package.json
python3 - "$VERSION" << 'EOF'
import json, sys
v = sys.argv[1]
path = "package.json"
with open(path) as f:
data = json.load(f)
data["version"] = v
with open(path, "w") as f:
json.dump(data, f, indent=2, ensure_ascii=False)
f.write("\n")
EOF
echo "→ Commit de version"
git add src-tauri/tauri.conf.json package.json
git commit -m "chore: bump version to $VERSION"
echo "→ Création du tag v$VERSION"
git tag "v$VERSION"
echo "→ Push vers Gitea"
git push origin main
git push origin "v$VERSION"
echo ""
echo "✓ Tag v$VERSION poussé — le workflow Gitea Actions va builder et créer la release automatiquement."
echo " Suivi : https://gitea.anthonybouteiller.ovh/blomios/TougliGui/actions"