-
Notifications
You must be signed in to change notification settings - Fork 1
171 lines (153 loc) · 5.99 KB
/
build.yml
File metadata and controls
171 lines (153 loc) · 5.99 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
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# This is a basic workflow to help you get started with Actions name: 'Tauri Build'
name: "Tauri Build"
# Controls when the action will run.
on:
# Triggers the workflow on tag push only
push:
tags:
- "v*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: write
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-22.04, windows-latest]
# platform: [ubuntu-22.04]
# platform: [windows-latest]
# The type of runner that the job will run on
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Cache Node modules
uses: actions/cache@v4
with:
# npm cache files are stored in ~/.npm
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup Rust toolchain (stable)
uses: dtolnay/rust-toolchain@stable
with:
# Only required targets will be downloaded depending on platform
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
# ----------------------------
# MACOS ONLY FIX
# ----------------------------
- name: Install macOS dependencies
if: matrix.platform == 'macos-latest'
run: |
brew install gnu-tar coreutils
echo "Homebrew dependencies installed"
# ----------------------------
# UBUNTU ONLY
# ----------------------------
- name: Install dependencies (Linux only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libsoup-3.0 \
libwebkit2gtk-4.1-dev
- name: Install Node dependencies
run: npm install --force
- name: Run unit tests (Linux only)
if: matrix.platform == 'ubuntu-22.04'
uses: GabrielBB/xvfb-action@v1
with:
run: npm run test
# ----------------------------
# BUILD TAURI
# ----------------------------
# Note: Windows and Linux builds use different updater configurations
# - Windows: updaterJsonPreferNsis=true (for .exe/.msi installers)
# - Linux: updaterJsonPreferNsis=false (for .AppImage/.deb packages)
# This fixes "invalid updater binary format" errors on Linux
- name: Build Tauri app (macOS Universal)
if: matrix.platform == 'macos-latest'
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
with:
tagName: ${{ github.ref_name }}
releaseName: "Release ${{ github.ref_name }}"
releaseBody: "New release"
releaseDraft: true
prerelease: false
includeRelease: true
includeDebug: false
includeUpdaterJson: true
updaterJsonPreferNsis: true
args: --target universal-apple-darwin
- name: Self-sign macOS app
if: matrix.platform == 'macos-latest'
run: |
# Find the app bundle in the release directory
APP_PATH=$(find src-tauri/target/*/release/bundle/macos -name "*.app" -type d | head -1)
if [ -z "$APP_PATH" ]; then
# Try alternative path
APP_PATH=$(find . -path "*/target/*/release/bundle/macos/*.app" -type d | head -1)
fi
if [ -n "$APP_PATH" ]; then
echo "Self-signing app at: $APP_PATH"
codesign --deep --force --verify --verbose --sign - "$APP_PATH"
echo "App signed successfully"
else
echo "App bundle not found, listing directories:"
find src-tauri/target -type d -name "bundle" 2>/dev/null | head -5
fi
- name: Build Tauri app (Windows)
if: matrix.platform == 'windows-latest'
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
with:
tagName: ${{ github.ref_name }}
releaseName: "Release ${{ github.ref_name }}"
releaseBody: "New release"
releaseDraft: true
includeRelease: true
includeDebug: false
includeUpdaterJson: true
updaterJsonPreferNsis: true
- name: Build Tauri app (Linux)
if: matrix.platform == 'ubuntu-22.04'
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
with:
tagName: ${{ github.ref_name }}
releaseName: "Release ${{ github.ref_name }}"
releaseBody: "New release"
releaseDraft: true
prerelease: false
includeRelease: true
includeDebug: false
includeUpdaterJson: true
updaterJsonPreferNsis: false