Compare commits
3 Commits
f571d8bb3f
...
v1.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 662a4b3e8a | |||
| bd97deb183 | |||
| 8e8ace85c5 |
161
.gitea/workflows/release.yml
Normal file
161
.gitea/workflows/release.yml
Normal 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
|
||||||
@ -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
61
release.sh
Executable 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"
|
||||||
@ -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",
|
||||||
|
|||||||
Reference in New Issue
Block a user