Repository navigation
237 lines (213 loc) Β· 7.89 KB
/
Copy pathbuild.yml
File metadata and controls
237 lines (213 loc) Β· 7.89 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
name: 'Build'
on:
workflow_dispatch:
pull_request:
paths:
- 'index.html'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- 'public/**'
- 'src/**'
- 'src-tauri/**'
- 'tsconfig*.json'
- 'vite.config.ts'
- '.github/actions/setup-tauri-build/**'
- '.github/actions/setup-portable-appimage/**'
- '.github/actions/upload-tauri-artifact/**'
- '.github/workflows/build.yml'
- 'scripts/normalize-appimage-zsync.sh'
push:
branches:
- main
- master
- develop
paths:
- 'index.html'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- 'public/**'
- 'src/**'
- 'src-tauri/**'
- 'tsconfig*.json'
- 'vite.config.ts'
- '.github/actions/setup-tauri-build/**'
- '.github/actions/setup-portable-appimage/**'
- '.github/actions/upload-tauri-artifact/**'
- '.github/workflows/build.yml'
- 'scripts/normalize-appimage-zsync.sh'
permissions:
contents: read
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-26'
label: 'macOS (Apple Silicon)'
artifact: 'macos-apple-silicon'
args: '--target aarch64-apple-darwin'
- platform: 'macos-26-intel'
label: 'macOS (Intel)'
artifact: 'macos-intel'
args: '--target x86_64-apple-darwin'
- platform: 'ubuntu-22.04'
label: 'Ubuntu'
artifact: 'linux-ubuntu'
rpm_artifact: 'linux-fedora'
args: '--bundles deb,rpm'
- platform: 'ubuntu-22.04-arm'
label: 'Ubuntu (ARM)'
artifact: 'linux-ubuntu-arm'
rpm_artifact: 'linux-fedora-arm'
args: '--bundles deb,rpm'
- platform: 'windows-latest'
label: 'Windows'
nsis_artifact: 'windows-nsis'
msi_artifact: 'windows-msi'
args: ''
- platform: 'windows-11-arm'
label: 'Windows (ARM)'
nsis_artifact: 'windows-arm-nsis'
msi_artifact: 'windows-arm-msi'
args: ''
runs-on: ${{ matrix.platform }}
name: ${{ matrix.label }}
timeout-minutes: 45
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup Tauri build
uses: ./.github/actions/setup-tauri-build
with:
platform: ${{ matrix.platform }}
rust-targets: ${{ matrix.platform == 'macos-26' && 'aarch64-apple-darwin' || '' }}
- name: Show Apple toolchain
if: startsWith(matrix.platform, 'macos')
shell: bash
run: |
xcodebuild -version
xcrun --sdk macosx --show-sdk-version
xcrun --sdk macosx --show-sdk-path
- uses: tauri-apps/tauri-action@84b9d35b5fc46c1e45415bdb6144030364f7ebc5 # v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MACOSX_DEPLOYMENT_TARGET: '12.0'
CARGO_TARGET_AARCH64_APPLE_DARWIN_RUSTFLAGS: '-C link-arg=-mmacosx-version-min=12.0'
CARGO_TARGET_X86_64_APPLE_DARWIN_RUSTFLAGS: '-C link-arg=-mmacosx-version-min=12.0'
with:
args: ${{ matrix.args }} --config '{"bundle":{"createUpdaterArtifacts":false}}'
- name: Upload macOS artifacts
if: startsWith(matrix.platform, 'macos')
uses: ./.github/actions/upload-tauri-artifact
with:
name: Chiri-${{ matrix.artifact }}
path: |
src-tauri/target/**/release/bundle/**/*.dmg
- name: Upload Ubuntu artifacts
if: startsWith(matrix.platform, 'ubuntu')
uses: ./.github/actions/upload-tauri-artifact
with:
name: Chiri-${{ matrix.artifact }}
path: |
src-tauri/target/**/release/bundle/**/*.deb
- name: Upload Fedora artifacts
if: startsWith(matrix.platform, 'ubuntu')
uses: ./.github/actions/upload-tauri-artifact
with:
name: Chiri-${{ matrix.rpm_artifact }}
path: |
src-tauri/target/**/release/bundle/**/*.rpm
- name: Upload Windows NSIS artifacts
if: startsWith(matrix.platform, 'windows')
uses: ./.github/actions/upload-tauri-artifact
with:
name: Chiri-${{ matrix.nsis_artifact }}
path: |
src-tauri/target/**/release/bundle/**/*-setup.exe
- name: Upload Windows MSI artifacts
if: startsWith(matrix.platform, 'windows')
uses: ./.github/actions/upload-tauri-artifact
with:
name: Chiri-${{ matrix.msi_artifact }}
path: |
src-tauri/target/**/release/bundle/**/*.msi
appimage:
strategy:
fail-fast: false
matrix:
include:
- platform: 'ubuntu-24.04'
label: 'AppImage (x86_64)'
artifact: 'linux-appimage'
arch: 'amd64'
- platform: 'ubuntu-24.04-arm'
label: 'AppImage (ARM64)'
artifact: 'linux-appimage-arm'
arch: 'aarch64'
runs-on: ${{ matrix.platform }}
container: ghcr.io/pkgforge-dev/archlinux@sha256:f6fc7e14b0612a355d7ab50efb3cc40010ba28e4766860bd238d313b308f190b
name: ${{ matrix.label }}
timeout-minutes: 60
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Setup portable AppImage build
uses: ./.github/actions/setup-portable-appimage
- name: Get Chiri version
id: version
shell: bash
run: echo "version=$(awk -F '"' '/^version = "/ { print $2; exit }' src-tauri/Cargo.toml)" >> "$GITHUB_OUTPUT"
- name: Build portable AppImage
uses: tauri-apps/tauri-action@84b9d35b5fc46c1e45415bdb6144030364f7ebc5 # v0
env:
TAURI_BUNDLER_NEW_APPIMAGE_FORMAT: 'true'
UPINFO: 'gh-releases-zsync|chiriapp|chiri|latest|Chiri_*_${{ matrix.arch }}.AppImage.zsync'
VERSION: ${{ steps.version.outputs.version }}
with:
tauriScript: cargo tauri
args: --bundles appimage --config src-tauri/tauri.appimage.conf.json --config '{"bundle":{"createUpdaterArtifacts":false}}'
- name: Verify AppImage update metadata
shell: bash
env:
APPIMAGE_ARCH: ${{ matrix.arch }}
VERSION: ${{ steps.version.outputs.version }}
run: |
set -euo pipefail
expected="garden.chiri.Chiri_${VERSION}_${APPIMAGE_ARCH}.AppImage.zsync"
mapfile -t zsync_paths < <(
find src-tauri/target \
-type f \
-path '*/release/bundle/appimage/*.AppImage.zsync' \
-name "$expected" \
-print
)
if [ "${#zsync_paths[@]}" -ne 1 ]; then
echo "::error::Expected exactly one AppImage zsync file named $expected"
printf '%s\n' "${zsync_paths[@]}"
exit 1
fi
appimage_path="${zsync_paths[0]%.zsync}"
expected_upinfo="gh-releases-zsync|chiriapp|chiri|latest|Chiri_*_${APPIMAGE_ARCH}.AppImage.zsync"
actual_upinfo="$("$appimage_path" --appimage-updateinformation)"
if [ "$actual_upinfo" != "$expected_upinfo" ]; then
echo "::error::Unexpected AppImage update information: $actual_upinfo"
exit 1
fi
PUBLIC_APPIMAGE_NAME="Chiri_${VERSION}_${APPIMAGE_ARCH}.AppImage" \
APPIMAGE_PATH="$appimage_path" \
bash scripts/normalize-appimage-zsync.sh
- name: Upload AppImage artifact
uses: ./.github/actions/upload-tauri-artifact
with:
name: Chiri-${{ matrix.artifact }}
path: |
src-tauri/target/**/release/bundle/**/*.AppImage
src-tauri/target/**/release/bundle/**/*.AppImage.zsync