Skip to content

chore: Update build.yml for improved workflow configuration #12

chore: Update build.yml for improved workflow configuration

chore: Update build.yml for improved workflow configuration #12

Workflow file for this run

# This is a basic workflow to help you get started with Actions name: 'Tauri Build'
name: "Tauri Build"
# Controls when the action will run.
on:
# Triggers the workflow on tag push only
push:
tags:
- "v*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-22.04, windows-latest]
# The type of runner that the job will run on
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Cache Node modules
uses: actions/cache@v4
with:
# npm cache files are stored in ~/.npm
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Rust toolchain (stable)
uses: dtolnay/rust-toolchain@stable
with:
# Only required targets will be downloaded depending on platform
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
# ----------------------------
# MACOS ONLY FIX
# ----------------------------
- name: Install macOS dependencies
if: matrix.platform == 'macos-latest'
run: |
brew install gnu-tar coreutils
echo "Homebrew dependencies installed"
# ----------------------------
# UBUNTU ONLY
# ----------------------------
- name: Install dependencies (Linux only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libsoup-3.0 \
libwebkit2gtk-4.1-dev
- name: Install Node dependencies
run: npm install
- name: Run unit tests (Linux only)
if: matrix.platform == 'ubuntu-22.04'
uses: GabrielBB/xvfb-action@v1
with:
run: npm run test
# ----------------------------
# BUILD TAURI
# ----------------------------
- name: Build Tauri app (macOS Universal)
if: matrix.platform == 'macos-latest'
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: ${{ github.ref_name }}
releaseName: "Release ${{ github.ref_name }}"
releaseBody: "New release"
releaseDraft: false
prerelease: false
includeRelease: true
includeDebug: false
args: --target universal-apple-darwin
- name: Build Tauri app (non-macOS)
if: matrix.platform != 'macos-latest'
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: ${{ github.ref_name }}
releaseName: "Release ${{ github.ref_name }}"
releaseBody: "New release"
releaseDraft: false
prerelease: false
includeRelease: true
includeDebug: false