liudonghua123 / tauri-build-action

MIT License
2 stars 1 forks source link

Tauri Build Action

GitHub Super-Linter CI Check dist/ CodeQL Coverage

This GitHub Action helps you build Tauri applications across different operating systems. It provides a streamlined way to set up, configure, and build Tauri projects using various templates and package managers.

Inputs

The action supports the following inputs, which are defined in the action.yml file:

Example Workflow

Here is an example of how to use the action in a workflow:

name: Tauri Build

on:
  push:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Install Dependencies
        run: npm install

      - uses: actions/setup-java@v4
        with:
          distribution: 'temurin'
          java-version: '21'

      - name: Tauri build
        id: tauri-build
        uses: liudonghua123/tauri-build-action@main
        with:
          project_name: ${{env.APP_NAME}}
          identifier: com.${{env.APP_NAME}}.app
          version: ${{ github.event.inputs.tag_version }}
          frontend_dist: ../dist
          icon: app-icon.png

      - name: Publish binary to release
        continue-on-error: true
        uses: softprops/action-gh-release@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          tag_name: ${{ github.event.inputs.tag_version }}
          files: tauri-build/*
          draft: false
          prerelease: false

Build Steps and Prerequisites

Linux

For Linux, the action installs the necessary dependencies and sets up the environment for cross-compiling to different architectures. The steps include:

  1. Adding the necessary repositories and updating the package list.
  2. Installing common dependencies.
  3. Installing x86_64 dependencies.
  4. Creating a .cargo/config.toml file for cross-compiling.
  5. Installing i386, aarch64, and armhf dependencies.
  6. Building for x86_64, i686, aarch64, and armv7 architectures.
  7. Building for Android.

macOS

For macOS, the action installs the necessary dependencies and sets up the environment for building Tauri applications. The steps include:

  1. Installing the necessary prerequisites.
  2. Initializing the iOS build environment.
  3. Building for x86_64, aarch64, and universal architectures.
  4. Building for iOS (currently commented out due to a signing issue).

Windows

For Windows, the action installs the necessary dependencies and sets up the environment for building Tauri applications. The steps include:

  1. Installing the necessary prerequisites.
  2. Building for x86_64, i686, and aarch64 architectures.