From 61a90db84859c1f90bb71c09053a043a774c542a Mon Sep 17 00:00:00 2001 From: m335671 Date: Thu, 17 Sep 2026 15:03:26 +0200 Subject: [PATCH 1/2] ci: split release workflow into GitHub-triggered and local act-test copies release_main.yml stays in sync with main (the version GitHub actually runs on push). The act-only fixes discovered while testing locally (Android SDK packages, gradlew CRLF, patchelf for linuxdeploy, etc.) now live in .github/workflows/local/release_main.yml, a file GitHub never auto-discovers since it's outside .github/workflows/ directly, so it can be re-run with act without ever affecting the real CI. Also ignore local .secrets/.env.latest backup files. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/local/release_main.yml | 218 +++++++++++++++++++++++ .github/workflows/release_main.yml | 21 ++- .gitignore | 2 + 3 files changed, 230 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/local/release_main.yml diff --git a/.github/workflows/local/release_main.yml b/.github/workflows/local/release_main.yml new file mode 100644 index 00000000..239d69ff --- /dev/null +++ b/.github/workflows/local/release_main.yml @@ -0,0 +1,218 @@ +name: Release on main (local act test) + +on: + push: + branches: [ main ] + +permissions: + contents: write + +jobs: + build-android-apk: + name: Build Android APK (debug) + runs-on: ubuntu-latest + steps: + - name: Checkout du code + uses: actions/checkout@v4 + + - name: Installation de Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Configuration du JDK + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '21' + + - name: Configuration du SDK Android + uses: android-actions/setup-android@v3 + with: + accept-android-sdk-licenses: true + packages: 'platform-tools' # le paquet legacy "tools" n'existe plus dans le repo Google (cf android-actions/setup-android#537) + + - name: Génération des fichiers .env + run: | + echo "${{ secrets.ENV_PRODUCTION }}" > .env.production + echo "${{ secrets.ENV_PRODUCTION }}" > .env + + - name: Installation des dépendances + run: bun install + + - name: Build des assets web + env: + NODE_OPTIONS: --max-old-space-size=6144 + run: bun run build + + - name: Synchronisation Capacitor Android + run: npx cap sync android + + - name: Build de l'APK debug (non signé) + working-directory: android + run: | + sed -i 's/\r$//' gradlew + chmod +x gradlew + sed -i '/org.gradle.java.home/d' gradle.properties # ignore un org.gradle.java.home local (chemin Windows non portable en CI) + ./gradlew assembleDebug + + - name: Upload de l'APK + uses: actions/upload-artifact@v4 + with: + name: synco-android-debug-apk + path: android/app/build/outputs/apk/debug/app-debug.apk + if-no-files-found: error + retention-days: 1 # additional safety for artifact retention + + build-windows-msi: + name: Build de l'installeur Windows (MSI) + runs-on: windows-latest + steps: + - name: Checkout du code + uses: actions/checkout@v4 + + - name: Installation de Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Installation des dépendances + shell: powershell + run: bun install + + - name: Build de l'installeur MSI + shell: powershell + env: + NODE_OPTIONS: --max-old-space-size=6144 + run: bunx tauri build --bundles msi + + - name: Upload du MSI + uses: actions/upload-artifact@v4 + with: + name: synco-windows-msi + path: src-tauri/target/release/bundle/msi/*.msi + if-no-files-found: error + retention-days: 1 # additional safety for artifact retention + + build-linux-appimage: + name: Build de l'AppImage Linux + runs-on: ubuntu-latest + steps: + - name: Checkout du code + uses: actions/checkout@v4 + + - name: Installation de Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Installation de Rust + uses: dtolnay/rust-toolchain@stable + + - name: Installation des dépendances système Tauri (Linux) + run: | + sudo apt-get update + sudo apt-get install -y libwebkit2gtk-4.1-dev libjavascriptcoregtk-4.1-dev \ + build-essential curl wget file libxdo-dev libssl-dev patchelf \ + libayatana-appindicator3-dev librsvg2-dev desktop-file-utils \ + gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad gstreamer1.0-libav \ + xdg-utils shared-mime-info + + - name: Génération des fichiers .env + run: | + echo "${{ secrets.ENV_PRODUCTION }}" > .env.production + echo "${{ secrets.ENV_PRODUCTION }}" > .env + + - name: Installation des dépendances + run: bun install + + - name: Build de l'AppImage + env: + NODE_OPTIONS: --max-old-space-size=6144 + APPIMAGE_EXTRACT_AND_RUN: "1" # linuxdeploy a besoin de FUSE, absent des runners/conteneurs ubuntu-24.04+ + NO_STRIP: "true" # le strip des binutils récents (ubuntu-24.04+) plante sur la section .relr.dyn de certaines libs (cf tauri-apps/tauri#15106) + run: bun run tauri:build -- --bundles appimage + + - name: Retrait de libwayland-client bundlée (EGL_BAD_PARAMETER sur Mesa 25+, cf tauri-apps/tauri#15665) + run: | + cd src-tauri/target/release/bundle/appimage + APPIMAGE=$(ls *.AppImage) + chmod +x "$APPIMAGE" + ./"$APPIMAGE" --appimage-extract + rm -f squashfs-root/usr/lib/libwayland-client.so.0 + curl -sL -o appimagetool https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage + chmod +x appimagetool + ./appimagetool --appimage-extract-and-run squashfs-root "$APPIMAGE" + rm -rf squashfs-root appimagetool + + - name: Upload de l'AppImage + uses: actions/upload-artifact@v4 + with: + name: synco-linux-appimage + path: src-tauri/target/release/bundle/appimage/*.AppImage + if-no-files-found: error + retention-days: 1 # additional safety for artifact retention + + build-docker-image: + name: Build et push de l'image Docker (front, prod) + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout du code + uses: actions/checkout@v4 + + - name: Owner du repo en minuscule (requis par GHCR) + id: meta + run: echo "owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" + + - name: Connexion à GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extraction des VITE_* depuis le secret ENV_PRODUCTION (build args) + id: env + run: | + echo "${{ secrets.ENV_PRODUCTION }}" > /tmp/env.production + { + echo "args<> "$GITHUB_OUTPUT" + + - name: Build et push de l'image prod + uses: docker/build-push-action@v6 + with: + context: . + target: prod + push: true + build-args: ${{ steps.env.outputs.args }} + tags: | + ghcr.io/${{ steps.meta.outputs.owner }}/synco_app:latest + ghcr.io/${{ steps.meta.outputs.owner }}/synco_app:${{ github.sha }} + + create-release: + name: Création de la release GitHub + needs: [ build-android-apk, build-windows-msi, build-linux-appimage ] + runs-on: ubuntu-latest + steps: + - name: Téléchargement des artefacts + uses: actions/download-artifact@v4 + with: + pattern: synco-* + path: release-assets + merge-multiple: true + + - name: Création de la release + uses: softprops/action-gh-release@v2 + with: + tag_name: dev-${{ github.run_number }} + name: "Synco dev build #${{ github.run_number }}" + prerelease: true + generate_release_notes: true + files: release-assets/** diff --git a/.github/workflows/release_main.yml b/.github/workflows/release_main.yml index 953740db..d862dc96 100644 --- a/.github/workflows/release_main.yml +++ b/.github/workflows/release_main.yml @@ -57,6 +57,7 @@ jobs: name: synco-android-debug-apk path: android/app/build/outputs/apk/debug/app-debug.apk if-no-files-found: error + retention-days: 1 # additional safety for artifact retention build-windows-msi: name: Build de l'installeur Windows (MSI) @@ -70,22 +71,15 @@ jobs: with: bun-version: latest - - name: Installation de Rust - uses: dtolnay/rust-toolchain@stable - - - name: Génération des fichiers .env - shell: bash - run: | - echo "${{ secrets.ENV_PRODUCTION }}" > .env.production - echo "${{ secrets.ENV_PRODUCTION }}" > .env - - name: Installation des dépendances + shell: powershell run: bun install - name: Build de l'installeur MSI + shell: powershell env: NODE_OPTIONS: --max-old-space-size=6144 - run: bun run tauri:build -- --bundles msi + run: bunx tauri build --bundles msi - name: Upload du MSI uses: actions/upload-artifact@v4 @@ -93,6 +87,7 @@ jobs: name: synco-windows-msi path: src-tauri/target/release/bundle/msi/*.msi if-no-files-found: error + retention-days: 1 # additional safety for artifact retention build-linux-appimage: name: Build de l'AppImage Linux @@ -114,7 +109,10 @@ jobs: sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev libjavascriptcoregtk-4.1-dev \ build-essential curl wget file libxdo-dev libssl-dev \ - libayatana-appindicator3-dev librsvg2-dev desktop-file-utils + libayatana-appindicator3-dev librsvg2-dev desktop-file-utils \ + gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad gstreamer1.0-libav \ + xdg-utils shared-mime-info - name: Génération des fichiers .env run: | @@ -147,6 +145,7 @@ jobs: name: synco-linux-appimage path: src-tauri/target/release/bundle/appimage/*.AppImage if-no-files-found: error + retention-days: 1 # additional safety for artifact retention build-docker-image: name: Build et push de l'image Docker (front, prod) diff --git a/.gitignore b/.gitignore index 4a6d2cb0..182caca5 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,8 @@ dist-ssr /.vite .env .env.prod +.secrets +.env.latest \n# Local AI Models\npublic/models\n /public/models .env.production From 36c0da463e15e3d271b3cc8ed17ba144e5c099ff Mon Sep 17 00:00:00 2001 From: m335 Date: Fri, 18 Sep 2026 19:40:51 +0200 Subject: [PATCH 2/2] fix(tauri): Linux desktop entry drops the deep-link callback URL tauri-bundler generates the Linux desktop entry with `Exec=` and no `%u` field code, even though it declares `MimeType=x-scheme-handler/fr.silvercore.synco`. Per the desktop entry spec, an Exec line without a field code launches the app without the URL it was asked to open, so the OAuth callback silently vanished when the browser resolved fr.silvercore.synco:// through that entry (AppImage/deb/rpm). Windows is unaffected since it uses the registry protocol handler instead. Known upstream bug: tauri-apps/tauri#15928. AppImageConfig has no desktopTemplate option of its own, but the AppImage bundler reuses the deb bundler's AppDir generation internally, so pointing bundle.linux.deb/rpm.desktopTemplate at a template with `Exec={{exec}} %u` fixes it for all three Linux targets. Verified by extracting a built AppImage: Exec=app %u (was Exec=app). Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_011Dt2EPaL3s8pHTW3acWXKK --- src-tauri/linux/main.desktop.hbs | 14 ++++++++++++++ src-tauri/tauri.conf.json | 6 ++++++ 2 files changed, 20 insertions(+) create mode 100644 src-tauri/linux/main.desktop.hbs diff --git a/src-tauri/linux/main.desktop.hbs b/src-tauri/linux/main.desktop.hbs new file mode 100644 index 00000000..063c11cf --- /dev/null +++ b/src-tauri/linux/main.desktop.hbs @@ -0,0 +1,14 @@ +[Desktop Entry] +Categories={{categories}} +{{#if comment}} +Comment={{comment}} +{{/if}} +Exec={{exec}} %u +StartupWMClass={{exec}} +Icon={{icon}} +Name={{name}} +Terminal=false +Type=Application +{{#if mime_type}} +MimeType={{mime_type}} +{{/if}} diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 77f9bbd1..5727a312 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -48,6 +48,12 @@ "linux": { "appimage": { "bundleMediaFramework": true + }, + "deb": { + "desktopTemplate": "linux/main.desktop.hbs" + }, + "rpm": { + "desktopTemplate": "linux/main.desktop.hbs" } } }