fix(ci): avoid tauri init in github actions and support v2.0.0 release #16
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ============================================================ | |
| # ThreadsVault Desktop — GitHub Actions Release Workflow | |
| # ============================================================ | |
| # | |
| # FASE 1: Solo build (verifica que la app compila en CI) ✓ | |
| # FASE 2: Subir artifacts (binarios disponibles en GitHub) ✓ | |
| # FASE 3: Crear Release automático al hacer git tag ✓ | |
| # | |
| # Uso: | |
| # git tag v1.0.1 | |
| # git push origin v1.0.1 | |
| # → Actions compila, sube artifacts y crea GitHub Release | |
| # | |
| # Documentación PBL: docs/0103/pbl-release-tasks.md | |
| # ============================================================ | |
| name: Release | |
| # ------------------------------------------------------------ | |
| # TRIGGER — FASE 3: solo cuando se hace push de un tag "v*" | |
| # | |
| # ¿Qué es un tag? Es una etiqueta que se pone a un commit | |
| # específico para marcarlo como versión. Convención: "v1.0.0". | |
| # | |
| # "git tag v1.0.1" → crea el tag localmente | |
| # "git push origin v1.0.1" → lo sube a GitHub → dispara este workflow | |
| # | |
| # El filtro "v*" significa: cualquier tag que empiece por "v". | |
| # Así "v1.0.0", "v2.3.1-beta" disparan el workflow, | |
| # pero "backup-2026" no lo dispara. | |
| # ------------------------------------------------------------ | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| publish_release: | |
| description: 'Crear GitHub Release (draft) con artifacts adjuntos' | |
| required: false | |
| default: false | |
| type: boolean | |
| # ------------------------------------------------------------ | |
| # PERMISSIONS: permisos que necesita el workflow. | |
| # "contents: write" permite crear GitHub Releases y subir | |
| # archivos adjuntos al release. Sin esto, el paso | |
| # create-release fallaría con "403 Forbidden". | |
| # ------------------------------------------------------------ | |
| permissions: | |
| contents: write | |
| jobs: | |
| # ---------------------------------------------------------- | |
| # JOB 1: Compilar en Windows y subir artifact | |
| # ---------------------------------------------------------- | |
| build-windows: | |
| name: Build (Windows) | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout código | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Instalar dependencias npm | |
| run: npm ci | |
| - name: Preparar sidecars embebidos (Windows) | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force src-tauri/bin | Out-Null | |
| Invoke-WebRequest -Uri "https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe" -OutFile "src-tauri/bin/yt-dlp.exe" | |
| Copy-Item "src-tauri/bin/yt-dlp.exe" "src-tauri/bin/yt-dlp" -Force | |
| choco install ffmpeg -y --no-progress | |
| Copy-Item "C:\\ProgramData\\chocolatey\\bin\\ffmpeg.exe" "src-tauri/bin/ffmpeg.exe" -Force | |
| Copy-Item "src-tauri/bin/ffmpeg.exe" "src-tauri/bin/ffmpeg" -Force | |
| - name: Doctor release (preflight) | |
| run: npm run doctor:release | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| src-tauri/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Build Tauri (Windows) | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tagName: ${{ github.ref_name }} | |
| projectPath: . | |
| includeTauri: false | |
| releaseName: 'ThreadsVault Desktop v${{ github.ref_name }}' | |
| releaseDraft: true | |
| prerelease: false | |
| - name: Subir artifacts (Windows) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-binaries | |
| path: | | |
| src-tauri/target/release/bundle/nsis/*.exe | |
| src-tauri/target/release/bundle/msi/*.msi | |
| retention-days: 7 | |
| if-no-files-found: error | |
| # ---------------------------------------------------------- | |
| # JOB 2: Compilar en Linux y subir artifact | |
| # ---------------------------------------------------------- | |
| build-linux: | |
| name: Build (Linux) | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout código | |
| uses: actions/checkout@v4 | |
| - name: Instalar dependencias del sistema (Linux) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libwebkit2gtk-4.1-dev \ | |
| libgtk-3-dev \ | |
| libayatana-appindicator3-dev \ | |
| librsvg2-dev \ | |
| patchelf | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Instalar dependencias npm | |
| run: npm ci | |
| - name: Preparar sidecars embebidos (Linux) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y yt-dlp ffmpeg | |
| mkdir -p src-tauri/bin | |
| cp /usr/bin/yt-dlp src-tauri/bin/yt-dlp | |
| cp /usr/bin/ffmpeg src-tauri/bin/ffmpeg | |
| # Placeholders para rutas .exe declaradas en recursos (no usadas en runtime Linux) | |
| printf "placeholder-yt-dlp-exe-linux\n" > src-tauri/bin/yt-dlp.exe | |
| printf "placeholder-ffmpeg-exe-linux\n" > src-tauri/bin/ffmpeg.exe | |
| - name: Doctor release (preflight) | |
| run: npm run doctor:release | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| src-tauri/target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Build Tauri (Linux) | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tagName: ${{ github.ref_name }} | |
| projectPath: . | |
| includeTauri: false | |
| releaseName: 'ThreadsVault Desktop v${{ github.ref_name }}' | |
| releaseDraft: true | |
| prerelease: false | |
| - name: Subir artifacts (Linux) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-binaries | |
| path: | | |
| src-tauri/target/release/bundle/appimage/*.AppImage | |
| src-tauri/target/release/bundle/deb/*.deb | |
| retention-days: 7 | |
| if-no-files-found: error | |
| # ---------------------------------------------------------- | |
| # JOB 3: Crear GitHub Release | |
| # | |
| # "needs" significa: espera a que build-windows Y build-linux | |
| # terminen con éxito antes de empezar este job. | |
| # Si cualquiera de los dos falla, este job no se ejecuta. | |
| # | |
| # Flujo: | |
| # 1. Descargar los artifacts subidos por los jobs anteriores | |
| # 2. Crear el GitHub Release con softprops/action-gh-release | |
| # 3. Adjuntar todos los binarios al release | |
| # ---------------------------------------------------------- | |
| create-release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| needs: [build-windows, build-linux] | |
| if: ${{ github.event_name == 'workflow_dispatch' && inputs.publish_release == true && startsWith(github.ref, 'refs/tags/v') }} | |
| steps: | |
| - name: Checkout código | |
| uses: actions/checkout@v4 | |
| # Descargar artifact de Windows generado en build-windows | |
| # Se descarga en la carpeta "artifacts/windows/" | |
| - name: Descargar artifacts Windows | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: windows-binaries | |
| path: artifacts/windows | |
| # Descargar artifact de Linux generado en build-linux | |
| - name: Descargar artifacts Linux | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: linux-binaries | |
| path: artifacts/linux | |
| # Listar los archivos descargados (útil para depurar si algo falla) | |
| - name: Listar artifacts descargados | |
| run: find artifacts/ -type f | sort | |
| # Crear el GitHub Release y adjuntar todos los binarios. | |
| # | |
| # softprops/action-gh-release es la acción más usada para esto. | |
| # Lee el tag del push (github.ref_name → "v1.0.1") y crea | |
| # un release con ese nombre. | |
| # | |
| # "files:" acepta glob patterns. "artifacts/**/*" = todos los | |
| # archivos dentro de cualquier subcarpeta de artifacts/. | |
| # | |
| # draft: true → el release se crea como borrador. | |
| # Puedes editarlo en GitHub antes de publicarlo. | |
| # Cuando estés listo, lo publicas manualmente con un clic. | |
| # Cambia a false cuando quieras publicación automática total. | |
| - name: Crear GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: ThreadsVault Desktop ${{ github.ref_name }} | |
| draft: true | |
| prerelease: false | |
| generate_release_notes: true | |
| files: artifacts/**/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |