-
Notifications
You must be signed in to change notification settings - Fork 173
135 lines (131 loc) · 5.25 KB
/
build-tauri.yml
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Build Tauri
on:
push:
branches-ignore:
- "master"
paths-ignore:
- "website"
workflow_call:
workflow_dispatch:
jobs:
build:
name: "Test Build"
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-22.04
name: linux
# https://tauri.app/v1/guides/building/linux#cross-compiling-tauri-applications-for-arm-based-devices
# Cross Compiling is also more of a pain it seems for linux atm, explore later
targets: "x86_64-unknown-linux-gnu"
tauri_target: ["x86_64-unknown-linux-gnu"]
- os: macos-latest
name: mac
targets: "aarch64-apple-darwin,x86_64-apple-darwin"
tauri_target: ["universal-apple-darwin"]
- os: windows-latest
name: win
targets: "aarch64-pc-windows-msvc,x86_64-pc-windows-msvc"
# The MSI installer is better integrated with the Add/Remove menu and feels more modern.
# The only real added benefit of NSIS is that the installer can have a custom logo.
# Also, nsis is the only one that currently works on arm64
# Another note is embedBootstrapper is enabled to improve support on window 7. Though windows 7 doesn't support arm64.
tauri_target:
[
"'aarch64-pc-windows-msvc --bundles nsis,updater'",
"'x86_64-pc-windows-msvc --bundles msi,updater'",
]
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: "yarn"
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.targets }}
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./app/tauri -> target"
- name: install dependencies (ubuntu only)
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1 build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev javascriptcoregtk-4.1
- name: Install NPM Packages
run: |
yarn install --immutable --network-timeout 120000
- name: Prepare for app notarization
if: startsWith(matrix.os[0], 'macos')
# Import Apple API key for app notarization on macOS
run: |
mkdir -p ~/private_keys/
echo '${{ secrets.APPLE_API_KEY_FILE }}' > ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8
- name: Build
shell: bash
run: |
for target in ${{ join(matrix.tauri_target, ' ') }}; do
yarn build:tauri --target $target --config ./app/tauri/release.conf.json
done
env:
APPLE_API_ISSUER: $${{ secrets.APPLE_API_ISSUER }}
APPLE_API_KEY_PATH: ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY }}.p8
APPLE_API_KEY: $${{ secrets.APPLE_API_KEY }}
APPLE_CERTIFICATE: $${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: $${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: $${{ secrets.APPLE_SIGNING_IDENTITY }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
# Possibly set up some basic unit testing just to make sure parts render and none of the libraries are straight up breaking
- uses: actions/upload-artifact@v3
with:
name: tauri-${{ matrix.name }}
path: |
app/tauri/target/*/release/bundle/**/*.AppImage
app/tauri/target/*/release/bundle/**/*.dmg
app/tauri/target/*/release/bundle/**/*.deb
app/tauri/target/*/release/bundle/**/msi/*.msi
app/tauri/target/*/release/bundle/**/nsis/*.exe
app/tauri/target/*/release/bundle/appimage/**/*.tar.gz
app/tauri/target/*/release/bundle/macos/**/*.tar.gz
app/tauri/target/*/release/bundle/**/*.zip
app/tauri/target/*/release/bundle/**/*.sig
generate-updater-file:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
# Download-artifact cannot do a wildcard and if all are downloaded it can download the results from the electron stage
# We could filter that but this is faster to avoid unneeded downloads.
- name: Download Win
uses: actions/download-artifact@v3
with:
name: tauri-win
path: artifacts/tauri-win
- name: Download Mac
uses: actions/download-artifact@v3
with:
name: tauri-mac
path: artifacts/tauri-mac
- name: Download Linux
uses: actions/download-artifact@v3
with:
name: tauri-linux
path: artifacts/tauri-linux
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
- name: Generate updater file
run: node app/tauri/release-prep/release-prep.js
- uses: actions/upload-artifact@v3
with:
name: tauri-release
path: |
release/*