1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Release
# Builds installers for every platform the README documents and attaches them to
# a GitHub Release. Triggered by pushing a tag such as gui-v0.6.0, matching the
# download URLs in README.md.
on:
push:
tags:
- 'gui-v*'
# Lets you re-run a build for an existing tag: select the tag as the ref when
# dispatching. Useful because a tag that was already pushed will not retrigger
# the push event above.
workflow_dispatch:
# tauri-action needs this to create the release and upload assets.
permissions:
contents: write
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.platform }}
strategy:
# Keep building the other platforms if one fails, so a single broken
# target does not cost you the whole release.
fail-fast: false
matrix:
include:
- name: macOS (Apple Silicon)
platform: macos-latest
target: aarch64-apple-darwin
args: '--target aarch64-apple-darwin'
- name: macOS (Intel)
platform: macos-latest
target: x86_64-apple-darwin
args: '--target x86_64-apple-darwin'
- name: Windows
platform: windows-latest
target: x86_64-pc-windows-msvc
args: ''
# Pinned to 22.04 rather than ubuntu-latest: binaries built against an
# older glibc run on newer distros, but not the reverse.
- name: Linux
platform: ubuntu-22.04
target: x86_64-unknown-linux-gnu
args: ''
steps:
- uses: actions/checkout@v4
- name: Install Linux build dependencies
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
# webkit2gtk-4.1 is the Tauri v2 webview; libxdo is needed for
# fileAssociations, patchelf for the AppImage bundle.
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libxdo-dev \
libssl-dev \
build-essential \
file \
wget
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
# Cargo.toml declares rust-version = "1.88".
targets: ${{ matrix.target }}
- name: Cache Rust build
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
- uses: actions/setup-node@v4
with:
node-version: 20
# npm ci installs strictly from the committed package-lock.json, so a
# release builds the same dependency tree every time.
- name: Install Tauri CLI
run: npm ci
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# macOS code signing is intentionally NOT configured here.
#
# Do not add these as `${{ secrets.APPLE_CERTIFICATE }}` while the
# secrets are unset: a missing secret expands to an empty string, so
# the variable is *defined but empty*. Tauri then treats signing as
# requested and fails with "failed to import keychain certificate",
# which is exactly how the first 0.6.0 build broke on both Macs.
#
# To enable signing, add the repository secrets first, then uncomment:
# APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
# APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
# APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
# APPLE_ID: ${{ secrets.APPLE_ID }}
# APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
# APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
with:
# Reuses the pushed tag, so assets land on gui-v0.6.0 rather than a
# new ref. On workflow_dispatch this resolves to the selected ref.
tagName: ${{ github.ref_name }}
releaseName: 'toMarkdown Viewer __VERSION__'
releaseBody: 'See the assets below to download and install.'
# Created as a draft so you can check the artifacts before anything is
# public. Set to false to publish automatically on tag push.
releaseDraft: true
prerelease: false
args: ${{ matrix.args }}