Skip to content

Merge pull request #261 from Choochmeque/dependabot/npm_and_yarn/exam… #215

Merge pull request #261 from Choochmeque/dependabot/npm_and_yarn/exam…

Merge pull request #261 from Choochmeque/dependabot/npm_and_yarn/exam… #215

Workflow file for this run

name: Build Demo
on:
pull_request:
push:
branches: ['**']
jobs:
# Build the example app on every desktop OS. Catches platform-specific
# regressions.
desktop:
name: build-demo (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: awalsh128/cache-apt-pkgs-action@latest
if: matrix.os == 'ubuntu-latest'
with:
packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf
version: "1.0"
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
examples/notifications-demo/src-tauri
- uses: pnpm/action-setup@v6
with:
run_install: false
- uses: actions/setup-node@v6
with:
node-version: "24"
cache: "pnpm"
- name: Build plugin JS bundle
run: |
pnpm install
pnpm build
- name: Install demo deps
working-directory: examples/notifications-demo
run: pnpm install
# `--no-bundle` skips creating .deb/.dmg/.msi installers — we only
# care that the app compiles & links on each OS, not that bundlers
# work. `--debug` skips release-mode codegen to keep CI fast.
- name: Build demo
working-directory: examples/notifications-demo
run: pnpm tauri build --debug --no-bundle
android:
name: build-demo (android)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "17"
- uses: android-actions/setup-android@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-linux-android
- uses: Swatinem/rust-cache@v2
- uses: pnpm/action-setup@v6
with:
run_install: false
- uses: actions/setup-node@v6
with:
node-version: "24"
cache: "pnpm"
- run: pnpm install && pnpm build
- working-directory: examples/notifications-demo
run: pnpm install
# The Google Services Gradle plugin needs `google-services.json` at
# build time but that file is gitignored (it carries Firebase
# credentials). CI copies the committed placeholder into place so the
# plugin loads — FCM won't work at runtime with these dummy values,
# but the build links and verifies the Android integration compiles.
- run: cp google-services.placeholder.json google-services.json
working-directory: examples/notifications-demo/src-tauri/gen/android/app
# `cargo-ndk` (used internally by `tauri android build`) needs
# `NDK_HOME` / `ANDROID_NDK_HOME`. The runner image exposes
# `ANDROID_NDK_LATEST_HOME` only as a shell variable (not in the
# Actions expression context), so forward it at runtime.
- working-directory: examples/notifications-demo
run: |
export NDK_HOME="$ANDROID_NDK_LATEST_HOME"
export ANDROID_NDK_HOME="$ANDROID_NDK_LATEST_HOME"
pnpm tauri android build --debug --apk --target aarch64
ios:
name: build-demo (ios)
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
- name: Select Xcode 26.5
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "26.5"
- name: Remove MetalToolchain (Tauri + Xcode 26 fix)
run: |
for i in 1 2 3; do
sudo xcodebuild -downloadComponent MetalToolchain && break
echo "Attempt $i failed; sleeping 15s and retrying"
sleep 15
done || echo "MetalToolchain catalog fetch still failing; continuing in case the asset is already on disk"
sudo xcodebuild -deleteComponent MetalToolchain
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-ios-sim
- uses: Swatinem/rust-cache@v2
- uses: pnpm/action-setup@v6
with:
run_install: false
- uses: actions/setup-node@v6
with:
node-version: "24"
cache: "pnpm"
- run: pnpm install && pnpm build
- working-directory: examples/notifications-demo
run: pnpm install
# iOS Simulator target skips Apple code signing.
- working-directory: examples/notifications-demo
run: pnpm tauri ios build --debug --target aarch64-sim