Compare commits

...

3 Commits

Author SHA1 Message Date
662a4b3e8a chore: bump version to 1.0.1
Some checks are pending
Release / create-release (push) Waiting to run
Release / build-linux (push) Blocked by required conditions
Release / build-windows (push) Blocked by required conditions
Release / build-macos (push) Blocked by required conditions
2026-04-21 22:16:04 +02:00
bd97deb183 chore: bump version to 1.0.0 2026-04-21 22:08:42 +02:00
8e8ace85c5 ci: add Gitea Actions release workflow and release script
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 22:07:42 +02:00
4 changed files with 224 additions and 2 deletions

View File

@ -0,0 +1,161 @@
name: Release
on:
push:
tags:
- 'v*'
env:
GITEA_URL: https://gitea.anthonybouteiller.ovh
GITEA_REPO: blomios/TougliGui
jobs:
# ── Crée la release Gitea à partir du tag ────────────────────────────────
create-release:
runs-on: [self-hosted, linux]
outputs:
release_id: ${{ steps.create.outputs.release_id }}
version: ${{ steps.version.outputs.version }}
steps:
- name: Extract version
id: version
run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
- name: Create Gitea release
id: create
run: |
RESPONSE=$(curl -s -X POST \
"$GITEA_URL/api/v1/repos/$GITEA_REPO/releases" \
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{
\"tag_name\": \"$GITHUB_REF_NAME\",
\"name\": \"TougliGui $GITHUB_REF_NAME\",
\"body\": \"Release $GITHUB_REF_NAME\",
\"draft\": false,
\"prerelease\": false
}")
echo "release_id=$(echo $RESPONSE | python3 -c 'import json,sys; print(json.load(sys.stdin)[\"id\"])')" >> $GITHUB_OUTPUT
# ── Build Linux ───────────────────────────────────────────────────────────
build-linux:
needs: create-release
runs-on: [self-hosted, linux]
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install system deps
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev \
librsvg2-dev patchelf
- name: Install npm deps
run: npm ci
- name: Build
run: npm run tauri build
- name: Upload artifacts
run: |
VERSION="${{ needs.create-release.outputs.version }}"
RELEASE_ID="${{ needs.create-release.outputs.release_id }}"
upload() {
FILE="$1"
NAME=$(basename "$FILE")
curl -s -X POST \
"$GITEA_URL/api/v1/repos/$GITEA_REPO/releases/$RELEASE_ID/assets?name=$NAME" \
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
-F "attachment=@$FILE"
}
find src-tauri/target/release/bundle/deb -name "*.deb" | while read f; do upload "$f"; done
find src-tauri/target/release/bundle/appimage -name "*.AppImage" | while read f; do upload "$f"; done
find src-tauri/target/release/bundle/rpm -name "*.rpm" | while read f; do upload "$f"; done
# ── Build Windows ─────────────────────────────────────────────────────────
build-windows:
needs: create-release
runs-on: [self-hosted, windows]
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Install npm deps
run: npm ci
- name: Build
run: npm run tauri build
- name: Upload artifacts
shell: bash
run: |
RELEASE_ID="${{ needs.create-release.outputs.release_id }}"
upload() {
FILE="$1"
NAME=$(basename "$FILE")
curl -s -X POST \
"$GITEA_URL/api/v1/repos/$GITEA_REPO/releases/$RELEASE_ID/assets?name=$NAME" \
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
-F "attachment=@$FILE"
}
find src-tauri/target/release/bundle/nsis -name "*.exe" | while read f; do upload "$f"; done
find src-tauri/target/release/bundle/msi -name "*.msi" | while read f; do upload "$f"; done
# ── Build macOS ───────────────────────────────────────────────────────────
build-macos:
needs: create-release
runs-on: [self-hosted, macos]
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin x86_64-apple-darwin
- name: Install npm deps
run: npm ci
- name: Build (universal)
run: npm run tauri build -- --target universal-apple-darwin
- name: Upload artifacts
run: |
RELEASE_ID="${{ needs.create-release.outputs.release_id }}"
upload() {
FILE="$1"
NAME=$(basename "$FILE")
curl -s -X POST \
"$GITEA_URL/api/v1/repos/$GITEA_REPO/releases/$RELEASE_ID/assets?name=$NAME" \
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
-F "attachment=@$FILE"
}
find src-tauri/target/universal-apple-darwin/release/bundle/dmg -name "*.dmg" | while read f; do upload "$f"; done
find src-tauri/target/universal-apple-darwin/release/bundle/macos -name "*.app.tar.gz" | while read f; do upload "$f"; done

View File

@ -1,7 +1,7 @@
{ {
"name": "toughligui-scaffold", "name": "toughligui-scaffold",
"private": true, "private": true,
"version": "0.1.0", "version": "1.0.1",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",

61
release.sh Executable file
View File

@ -0,0 +1,61 @@
#!/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"

View File

@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "TougliGui", "productName": "TougliGui",
"version": "0.1.0", "version": "1.0.1",
"identifier": "com.anthony.toughligui", "identifier": "com.anthony.toughligui",
"build": { "build": {
"beforeDevCommand": "npm run dev", "beforeDevCommand": "npm run dev",