• Stars
    star
    870
  • Rank 52,440 (Top 2 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Build your Web application as a Tauri binary for macOS, Linux and Windows

Tauri GitHub Action

This GitHub Action builds your Web application as a Tauri native binary for macOS, Linux and Windows. If your project doesn't include the Tauri files, we create it at compile time, so if you don't need to use Tauri's API, you can just ship native apps through this Action.

Usage

This GitHub Action has three main usages: test the build pipeline of your Tauri app, uploading Tauri artifacts to an existing release, and creating a new release with the Tauri artifacts.

Testing the Build

name: 'test-on-pr'
on: [pull_request]

jobs:
  test-tauri:
    strategy:
      fail-fast: false
      matrix:
        platform: [macos-latest, ubuntu-20.04, windows-latest]

    runs-on: ${{ matrix.platform }}
    steps:
      - uses: actions/checkout@v3
      - name: setup node
        uses: actions/setup-node@v3
        with:
          node-version: 16
      - name: install Rust stable
        uses: dtolnay/rust-toolchain@stable
      - name: install dependencies (ubuntu only)
        if: matrix.platform == 'ubuntu-20.04'
        run: |
          sudo apt-get update
          sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
      - name: install frontend dependencies
        run: yarn install # change this to npm or pnpm depending on which one you use
      - uses: tauri-apps/tauri-action@v0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Creating a release and uploading the Tauri bundles

In this example tauri-action will create the GitHub release itself. It will build and upload the app bundles to the newly created release.

This is generally the simplest way to release your Tauri app.

name: 'publish'
on:
  push:
    branches:
      - release

jobs:
  publish-tauri:
    permissions:
      contents: write
    strategy:
      fail-fast: false
      matrix:
        platform: [macos-latest, ubuntu-20.04, windows-latest]

    runs-on: ${{ matrix.platform }}
    steps:
      - uses: actions/checkout@v3
      - name: setup node
        uses: actions/setup-node@v3
        with:
          node-version: 16
      - name: install Rust stable
        uses: dtolnay/rust-toolchain@stable
      - name: install dependencies (ubuntu only)
        if: matrix.platform == 'ubuntu-20.04'
        run: |
          sudo apt-get update
          sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
      - name: install frontend dependencies
        run: yarn install # change this to npm or pnpm depending on which one you use
      - uses: tauri-apps/tauri-action@v0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
          releaseName: 'App v__VERSION__'
          releaseBody: 'See the assets to download this version and install.'
          releaseDraft: true
          prerelease: false

Uploading the artifacts to a release

tauri-action can also upload app bundles to an existing GitHub release. This workflow uses different actions to create and publish the release. tauri-action will only build and upload the app bundles to the specified release.

name: 'publish'

on: pull_request

jobs:
  create-release:
    permissions:
      contents: write
    runs-on: ubuntu-20.04
    outputs:
      release_id: ${{ steps.create-release.outputs.result }}

    steps:
      - uses: actions/checkout@v3
      - name: setup node
        uses: actions/setup-node@v3
        with:
          node-version: 16
      - name: get version
        run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
      - name: create release
        id: create-release
        uses: actions/github-script@v6
        with:
          script: |
            const { data } = await github.rest.repos.createRelease({
              owner: context.repo.owner,
              repo: context.repo.repo,
              tag_name: `app-v${process.env.PACKAGE_VERSION}`,
              name: `Desktop App v${process.env.PACKAGE_VERSION}`,
              body: 'Take a look at the assets to download and install this app.',
              draft: true,
              prerelease: false
            })
            return data.id

  build-tauri:
    needs: create-release
    permissions:
      contents: write
    strategy:
      fail-fast: false
      matrix:
        platform: [macos-latest, ubuntu-20.04, windows-latest]

    runs-on: ${{ matrix.platform }}
    steps:
      - uses: actions/checkout@v3
      - name: setup node
        uses: actions/setup-node@v3
        with:
          node-version: 16
      - name: install Rust stable
        uses: dtolnay/rust-toolchain@stable
      - name: install dependencies (ubuntu only)
        if: matrix.platform == 'ubuntu-20.04'
        run: |
          sudo apt-get update
          sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
      - name: install frontend dependencies
        run: yarn install # change this to npm or pnpm depending on which one you use
      - uses: tauri-apps/tauri-action@v0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          releaseId: ${{ needs.create-release.outputs.release_id }}

  publish-release:
    permissions:
      contents: write
    runs-on: ubuntu-20.04
    needs: [create-release, build-tauri]

    steps:
      - name: publish release
        id: publish-release
        uses: actions/github-script@v6
        env:
          release_id: ${{ needs.create-release.outputs.release_id }}
        with:
          script: |
            github.rest.repos.updateRelease({
              owner: context.repo.owner,
              repo: context.repo.repo,
              release_id: process.env.release_id,
              draft: false,
              prerelease: false
            })

Inputs

Project Initialization

These inputs are typically only used if your GitHub repo does not contain an existing Tauri project and you want the action to initialize it for you.

Name Required Description Type Default
projectPath false The path to the root of the tauri project relative to the current working directory string .
distPath false Path to the distributable folder with your index.html and JS/CSS string
iconPath false path to the PNG icon to use as app icon, relative to the projectPath string
bundleIdentifier yes, if not set via --config the bundle identifier to inject when initializing the Tauri app string

Build Options

These inputs allow you to change how your Tauri project will be build.

Name Required Description Type Default
projectPath false The path to the root of the tauri project relative to the current working directory string .
includeDebug false whether to include a debug build or not bool false
includeRelease false whether to include a release build or not bool true
includeUpdaterJson false whether to upload a JSON file for the updater or not (only relevant if the updater is configured) bool true
updaterJsonPreferNsis false whether the action will use the NSIS (setup.exe) or WiX (.msi) bundles for the updater JSON if both types exist bool false for Tauri v1 and true for Tauri v2+
updaterJsonKeepUniversal false whether the updater JSON file should include universal macOS builds as darwin-universal on top of using it in the aarch64 and x86_64 fields. bool false
tauriScript false the script to execute the Tauri CLI. It must not include any args or commands like build string npm run|pnpm|yarn tauri
args false Additional arguments to the current build command string

Release Configuration

These inputs allow you to modify the GitHub release.

Name Required Description Type Default
releaseId false The id of the release to upload artifacts as release assets string
tagName false The tag name of the release to create or the tag of the release belonging to releaseId string
releaseName false The name of the release to create string
releaseBody false The body of the release to create string
releaseDraft false Whether the release to create is a draft or not bool false
prerelease false Whether the release to create is a prerelease or not bool false
releaseCommitish false Any branch or commit SHA the Git tag is created from, unused if the Git tag already exists string SHA of current commit
owner false The account owner of the repository the release will be uploaded to. Requires GITHUB_TOKEN in env and a releaseCommitish target if it doesn't match the current repo. string owner of the current repo
repo false The name of the repository the release will be uploaded to. Requires GITHUB_TOKEN in env and a releaseCommitish target if it doesn't match the current repo. string name of the current repo

Outputs

Name Description
releaseId The ID of the created release
releaseHtmlUrl The URL users can navigate to in order to view the created release
releaseUploadUrl The URL for uploading assets to the created release
artifactPaths The paths of the generated artifacts

Caveats

  • You can use this Action on a repo that doesn't have Tauri configured. We automatically initialize Tauri before building, and configure it to use your Web artifacts.
    • You can configure the project initialization with the distPath and iconPath options.
    • If you need to further customize the default tauri.conf.json file you can add a custom config that will be merged with the default one at build time.
      • args: --config custom-config.json
  • You can run custom Tauri CLI scripts with the tauriScript option. So instead of running yarn tauri <COMMAND> <ARGS> or npm run tauri <COMMAND> <ARGS>, we'll execute ${tauriScript} <COMMAND> <ARGS>.
    • Useful when you need custom build functionality when creating Tauri apps e.g. a desktop:build script.
    • tauriScript can also be an absolute file path pointing to a tauri-cli binary. The path currently cannot contain spaces.
  • If you want to add additional arguments to the build command, you can use the args option. For example, if you're setting a specific target for your build, you can specify args: --target your-target-arch.
  • When your Tauri app is not in the root of the repo, use the projectPath input.
    • Usually it will work without it, but the action will install and use a global @tauri-apps/cli installation instead of your project's CLI which can cause issues if you also configured tauriScript or if you have multiple tauri.conf.json files in your repo.
    • Additionally, relative paths provided via the --config flag will be resolved relative to the projectPath to match Tauri's behavior.
  • If you create the release yourself and provide a releaseId but do not set tagName, the download url for updater bundles in latest.json will point to releases/latest/download/<bundle> which can cause issues if your repo contains releases that do not include updater bundles.

More Repositories

1

tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
Rust
81,362
star
2

awesome-tauri

🚀 Awesome Tauri Apps, Plugins and Resources
4,224
star
3

wry

Cross-platform WebView library in Rust for Tauri.
Rust
3,491
star
4

cargo-mobile2

Rust on mobile made easy!
Rust
1,566
star
5

tao

The TAO of cross-platform windowing. A library in Rust built for Tauri.
Rust
1,532
star
6

create-tauri-app

Rapidly scaffold out a new tauri app project.
Rust
979
star
7

plugins-workspace

All of the official Tauri plugins in one place!
Rust
807
star
8

tauri-docs

The source for all Tauri project documentation.
MDX
769
star
9

window-vibrancy

Make your windows vibrant.
Rust
609
star
10

tauri-vscode

Visual Studio Code Extension for Tauri apps development
TypeScript
459
star
11

vue-cli-plugin-tauri

Turn your Vue SPA into a lightweight cross-platform desktop app
JavaScript
372
star
12

tauri-plugin-sql

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
365
star
13

tauri-egui

Rust
343
star
14

tauri-plugin-store

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
275
star
15

muda

Menu Utilities for Desktop Applications in Rust.
Rust
234
star
16

tray-icon

Tray icons for Desktop Applications.
Rust
199
star
17

window-shadows

Add native shadows to your windows.
Rust
160
star
18

tauri-bindgen

Typesafe language bindings generator for the Tauri IPC bridge
Rust
142
star
19

webkit2gtk-rs

WebKit2 bindings and wrappers for Rust
Rust
136
star
20

global-hotkey

Global hotkeys for Desktop Applications.
Rust
127
star
21

tauri-plugin-window-state

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
125
star
22

tauri-plugin-log

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
111
star
23

javascriptcore-rs

JavaScriptCore bindings and wrappers for Rust
Rust
91
star
24

tauri-plugin-positioner

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
91
star
25

meilisearch-docsearch

A quick search component for meilisearch, inspired by algolia/docsearch.
TypeScript
88
star
26

tauri-plugin-stronghold

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
88
star
27

tauri-plugin-authenticator

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
86
star
28

smoke-tests

A collection of frameworks used as a suite of smoke-tests for tauri
JavaScript
76
star
29

tauri-plugin-autostart

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
63
star
30

tauri-plugin-fs-watch

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
62
star
31

tauri-plugin-websocket

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
58
star
32

tauri-plugin-localhost

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
56
star
33

tauri-invoke-http

A custom invoke system for Tauri that leverages a localhost server
Rust
47
star
34

fix-path-env-rs

Rust
44
star
35

libappindicator-rs

Rust safe bindings for the libappindicator library
Rust
44
star
36

tauri-plugin-fs-extra

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
TypeScript
43
star
37

tauri-theia

Tauri Flavor of Theia
Rust
39
star
38

tauricon

Make icons for your tauri app with nodejs
TypeScript
30
star
39

tauri-plugin-upload

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
29
star
40

tauri-plugin-single-instance

[DEPRECATED] Please use the plugin from https://github.com/tauri-apps/plugins-workspace instead.
Rust
25
star
41

win7-notifications

Send Windows 10 styled notifications on Windows 7.
Rust
19
star
42

tauri-forage

Currified localForage with a side of extras.
TypeScript
18
star
43

tauri-hotkey-rs

Rust
17
star
44

rfcs

Request For Comments for the Tauri project
17
star
45

tauri-discord-bot

Tauri's Discord Bot
TypeScript
17
star
46

nsis-tauri-utils

A collection of NSIS plugins written in rust.
Rust
16
star
47

tauri-plugin-notification

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Kotlin
12
star
48

benchmark_results

11
star
49

tauri-github-bot

A GitHub bot for tauri-apps org to automate various tasks and intended to used only by tauri-apps org members.
TypeScript
10
star
50

gipfs

Git ops with IPFS
9
star
51

binary-releases

Prebuilt binaries for Tauri projects
9
star
52

governance-and-guidance

Rust
8
star
53

tauri-plugin-http

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
8
star
54

.github

Holds org-wide configuration files.
7
star
55

meetings

7
star
56

tauri-plugin-updater

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
7
star
57

tauri-search

[Archived] Tauri's Search Capabilities for Website leveraging MeiliSearch
TypeScript
6
star
58

tauri-plugin-shell

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
6
star
59

realworld

Realworld apps made with Tauri: Proof of Agnosis.
JavaScript
6
star
60

tauri.studio

Source code and build for the front-facing project website.
Vue
6
star
61

tauri-plugin-clipboard-manager

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
6
star
62

wry-mobile

Rust
6
star
63

tauri-plugin-fs

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
6
star
64

tauri-includedir

Rust
5
star
65

rustdocusaurus

POC—turning rustdoc generated docs into Docusaurus (MD + sidebar)
JavaScript
5
star
66

docusaurus-meilisearch-indexer

JavaScript
5
star
67

tauri-plugin-os

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
JavaScript
5
star
68

tauri-plugin-persisted-scope

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
5
star
69

tauri-plugin-process

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
JavaScript
5
star
70

tauri-plugin-global-shortcut

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
5
star
71

dns-automation

This repo will manage DNS records automagically. Implementing Infrastructure as Code & GitOps practices.
HCL
4
star
72

tauri-plugin-dialog

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
4
star
73

tauri-plugin-cli

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
Rust
4
star
74

tauri-webpack

[Deprecated] webpack for no server
JavaScript
3
star
75

typedocusaurus

TypeScript
3
star
76

soup2-rs

Rust
2
star
77

benchmark_electron

Rust
2
star
78

automation

GitHub Actions available to the tauri-apps organization
JavaScript
2
star
79

gir-files

Shell
2
star
80

workflow-testbed

Test bed that will soon be deleted.
2
star
81

tauri-inliner-rs

Rust
1
star
82

tauri-plugin-window

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
TypeScript
1
star
83

msedgedriver-manifest-cache

A caching service (in the form of a static site) of the msedgedriver version manifest file that seems to go missing a lot.
Rust
1
star
84

tauri-dialog-rs

C
1
star
85

board-voter

Vue
1
star
86

tauri-plugin-app

[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace
JavaScript
1
star