-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (95 loc) · 3.54 KB
/
Copy pathrelease.yml
File metadata and controls
110 lines (95 loc) · 3.54 KB
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
# Builds the installers for Windows, macOS and Linux and attaches them to a
# GitHub Release.
#
# Nothing here runs on its own: a release is cut by pushing a version tag.
#
# npm version 0.1.1 --no-git-tag-version
# git commit -am "release 0.1.1"
# git tag v0.1.1
# git push origin main --tags
#
# One number, in package.json. `tauri.conf.json` reads its version from there,
# so the installer, the About line and the tag cannot drift apart. The version
# in `Cargo.toml` names the crate and nothing a user ever sees.
#
# The workflow then produces a *draft* release. Check the files, write the
# notes, and publish it by hand. A draft is the last chance to catch a broken
# build before anyone downloads it.
name: Release
on:
push:
tags:
- "v*"
# Lets you produce the installers from the Actions tab without tagging,
# to test the pipeline itself.
workflow_dispatch:
permissions:
contents: write
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
# One universal binary covering both Intel and Apple Silicon.
- platform: macos-latest
target: universal-apple-darwin
label: macOS
- platform: ubuntu-22.04
target: ""
label: Linux
- platform: windows-latest
target: ""
label: Windows
name: ${{ matrix.label }}
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Install Linux build dependencies
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
libssl-dev \
patchelf \
file
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target == 'universal-apple-darwin' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- run: npm ci
# Tauri embeds the built frontend at compile time, so `dist/` has to
# exist before the Rust crate, tests included, will compile at all.
- run: npm run build
# The detector and the unsubscribe logic are the product; a release that
# fails their tests must not be built at all.
- name: Backend tests
working-directory: src-tauri
run: cargo test --lib
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Empty on a manual run: tauri-action then builds the installers and
# creates no release, which is the point of testing the pipeline from
# the Actions tab without cutting a version.
tagName: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '' }}
releaseName: ${{ startsWith(github.ref, 'refs/tags/') && format('PurifyMail {0}', github.ref_name) || '' }}
releaseBody: |
Installers for Windows, macOS and Linux are attached below.
The binaries are **not code-signed**, so your system will warn you
the first time you open the app. See the README for what the
warning looks like and how to get past it.
releaseDraft: true
prerelease: false
args: ${{ matrix.target != '' && format('--target {0}', matrix.target) || '' }}