Ship Tauri 2 to Mac, Windows & Linux | GitHub Actions Matrix Tutorial
0views
C
CelesteAI
Description
The mature answer to cross-platform desktop distribution is to let GitHub Actions do the work. One tag push, three runners in parallel, three installers attached to a Release. No cross-compilation, no platform-specific tooling on your laptop, no nightly builds of "the Windows one."
Source code: https://github.com/GoCelesteAI/tauri_triship
We build TriShip, a minimal Tauri 2 app that does nothing but show its host OS, and then wire up a 35-line .github/workflows/release.yml that produces a .dmg, a Windows .exe installer, and a Linux .AppImage from a single git tag v0.1.0 && git push origin v0.1.0. The full Release page with all three downloads is the proof.
What You'll Learn:
- bundle.targets in tauri.conf.json — dmg + nsis + deb + appimage in one config. Tauri build skips targets that don't apply to the current host, so one config covers all three runners.
- on: push: tags: v-star — triggering the workflow only on tagged commits. Normal pushes to main don't fire it, which keeps "development" and "release" cleanly separated.
- permissions: contents: write — the per-workflow opt-in that lets the default GITHUB_TOKEN create a Release. Without it, the upload step fails with a 403.
- strategy.matrix with three platform entries — one matrix entry per OS, target triple, and artifact glob. fail-fast false keeps one platform's failure from cancelling the others.
- Per-platform deps via if: matrix.platform.os == — only Linux needs webkit, app-indicator, librsvg, and patchelf. macOS and Windows have the equivalents built into the OS.
- dtolnay/rust-toolchain, pnpm/action-setup, actions/setup-node — the standard toolchain trio. With cache pnpm, subsequent runs save 1-2 minutes per platform.
- softprops/action-gh-release — one action handles tag matching, idempotent Release creation, concurrent uploads, and hash digests. All three jobs upload to the same Release matched by tag name.
Timestamps:
0:00 - The proof: three installers on one Release page
0:29 - Bundle targets in tauri.conf.json
0:54 - Workflow triggers + permissions
1:21 - The matrix and runner setup
2:01 - Steps: Linux deps, toolchain, build, upload
2:55 - Git tag push triggers all three platforms
3:29 - Live demo of the Releases + Actions flow
4:14 - Recap and end
Key Takeaways:
1. The matrix is a force multiplier. Three platform entries become three parallel runners. Total wall time is the slowest job, not the sum of all three. macOS typically finishes in 2-3 minutes; Windows and Linux are usually 5-6 minutes each. Wall-clock cost of the entire pipeline is bounded by the slowest one.
2. Tauri build is smart about host-platform targets. You list dmg, nsis, deb, and appimage in bundle.targets, but only the ones that match the current OS actually produce output. No conditionals needed in the workflow file.
3. fail-fast: false is non-optional for cross-platform CI. With it, one platform breaking (say, a Windows-specific Rust regression) cancels the other two jobs, hiding what was actually wrong. Without it, you see exactly which platforms failed and which succeeded.
4. The contents-write permission has to be explicit. This is the most common first-time-fail. The default workflow token is read-only — a sensible security default but invisible when you're new. Add the four-line permissions block and the release step starts working.
5. action-gh-release does idempotent uploads to a single Release. All three jobs run the same upload step with different files; the action creates the Release once and attaches each artifact to it. Order doesn't matter, retries don't duplicate, and the resulting Release is the same shape regardless of which job finished first.
This channel is run by Claude AI. Tutorials AI-produced; reviewed and published by Codegiz. Source code at codegiz.com.
Part of Tauri Patterns for Production — full playlist linked in the description.
#Tauri #Tauri2 #Rust #DesktopApp #React #TypeScript #GitHubActions #CICD #CrossPlatform #ClaudeAI
---
Generated by Claude AI · part of the Tauri Patterns for Production series