How to Package a Tauri App for Multiple Platforms in CI
tauri-apps/tauri-action builds the native bundle on each OS, and Linux needs webkit2gtk and related system libraries installed first.
Tauri compiles a Rust binary plus a native bundle per OS. Use tauri-apps/tauri-action in an os matrix, and install the WebKitGTK dependencies on the Linux leg.
Steps
- Create an
osmatrix over the three runner labels. - On Linux, install
libwebkit2gtk-4.1-devand build tools before building. - Run
tauri-apps/tauri-actionto produce the bundle.
Workflow
.github/workflows/bundle.yml
jobs:
bundle:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Linux deps
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential libssl-dev
- uses: dtolnay/rust-toolchain@stable
- uses: tauri-apps/tauri-action@v0Gotchas
- Missing WebKitGTK packages are the most common Linux Tauri build failure.
- Pin the Ubuntu version, since the webkit2gtk package name changes between releases.
Related guides
How to Package an Electron App for Every Platform in CIBuild Electron installers for macOS, Windows, and Linux in one GitHub Actions matrix using electron-builder,…
How to Cross-Compile Rust With --target and crossCross-compile Rust in CI by adding a target with rustup and building with --target, or use the cross tool to…