-
-
Notifications
You must be signed in to change notification settings - Fork 3
215 lines (191 loc) · 9.18 KB
/
Copy pathrelease.yml
File metadata and controls
215 lines (191 loc) · 9.18 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
name: Release
on:
push:
tags:
- 'v*'
jobs:
macos:
permissions:
contents: write
strategy:
fail-fast: false
max-parallel: 1
matrix:
include:
- args: --target aarch64-apple-darwin --bundles dmg,app
- args: --target x86_64-apple-darwin --bundles dmg,app
runs-on: macos-latest
env:
CMAKE_POLICY_VERSION_MINIMUM: '3.5'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin,x86_64-apple-darwin
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Install JS deps
run: bun install --frozen-lockfile
- name: Build & release
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 }}
with:
projectPath: src-tauri
tagName: ${{ github.ref_name }}
releaseName: Splitwave ${{ github.ref_name }}
releaseDraft: true
prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }}
args: ${{ matrix.args }}
linux:
# last, so the latest.json patch lands after the other jobs write it
needs: [macos, windows]
permissions:
contents: write
# oldest base with WebKitGTK 4.1 -> glibc 2.35 for AppImage compat
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Install Linux system deps
# PPA backports a libpipewire new enough for the libspa crate
run: |
sudo add-apt-repository -y ppa:pipewire-debian/pipewire-upstream
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libwebkit2gtk-4.1-dev libjavascriptcoregtk-4.1-dev \
libgtk-3-dev librsvg2-dev librsvg2-bin libgtk-3-bin \
libayatana-appindicator3-dev libsoup-3.0-dev libssl-dev \
libpipewire-0.3-dev clang libclang-dev \
libasound2-dev libopus-dev libpulse-dev \
desktop-file-utils xdg-utils patchelf rpm
- name: Install JS deps
run: bun install --frozen-lockfile
- name: Build, sign & release
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 }}
with:
projectPath: src-tauri
tagName: ${{ github.ref_name }}
releaseName: Splitwave ${{ github.ref_name }}
releaseDraft: true
prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }}
args: --bundles appimage,deb,rpm
# linuxdeploy bundles libwayland/libpipewire/libspa; on newer Mesa they
# shadow the host libs and break EGL/PipeWire. Drop them, use the host's.
- name: Strip bundled host libs from AppImage
run: |
set -euxo pipefail
export APPIMAGE_EXTRACT_AND_RUN=1
app=$(find src-tauri/target/release/bundle/appimage -name '*.AppImage' | head -1)
"$app" --appimage-extract
rm -fv squashfs-root/usr/lib/libwayland-client.so* \
squashfs-root/usr/lib/libwayland-egl.so* \
squashfs-root/usr/lib/libwayland-cursor.so* \
squashfs-root/usr/lib/libpipewire-0.3.so* \
squashfs-root/usr/lib/libspa-0.2.so*
curl -fsSL -o /tmp/appimagetool \
https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x /tmp/appimagetool
rm -f "$app"
ARCH=x86_64 /tmp/appimagetool squashfs-root "$app"
rm -rf squashfs-root
# updater verifies the .AppImage itself (not the tarball); the strip
# changed it, so the old signature is stale.
- name: Re-sign stripped AppImage
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: |
set -euxo pipefail
app=$(find src-tauri/target/release/bundle/appimage -maxdepth 1 -name '*.AppImage' | head -1)
rm -f "$app.sig"
bun run tauri signer sign "$app"
# url still points at the same-named .AppImage; only the signature
# changed. startswith covers linux-x86_64 and linux-x86_64-appimage.
- name: Patch latest.json with new Linux signature
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euxo pipefail
tag="${{ github.ref_name }}"
repo="${{ github.repository }}"
app=$(find src-tauri/target/release/bundle/appimage -maxdepth 1 -name '*.AppImage' | head -1)
newsig=$(cat "$app.sig")
rid=$(gh api "repos/$repo/releases" --jq "[.[] | select(.tag_name==\"$tag\")][0].id")
aid=$(gh api "repos/$repo/releases/$rid/assets" --jq '[.[] | select(.name=="latest.json")][0].id')
gh api "repos/$repo/releases/assets/$aid" -H "Accept: application/octet-stream" > latest.json
jq --arg s "$newsig" '.platforms |= with_entries(if (.key | startswith("linux-x86_64")) then .value.signature = $s else . end)' latest.json > latest.json.tmp
mv latest.json.tmp latest.json
cat latest.json
# softprops replaces the same-named un-stripped assets
- name: Replace AppImage, signature & manifest on release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
draft: true
files: |
src-tauri/target/release/bundle/appimage/*.AppImage
src-tauri/target/release/bundle/appimage/*.AppImage.sig
latest.json
windows:
# Runs after macOS so the draft release already exists to upload into.
needs: macos
permissions:
contents: write
runs-on: windows-latest
env:
# windows-latest ships CMake 4.x, which rejects audiopus_sys's pre-3.5
# policy version without this override.
CMAKE_POLICY_VERSION_MINIMUM: '3.5'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo build
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Install JS deps
run: bun install --frozen-lockfile
- name: Build & release
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 }}
with:
projectPath: src-tauri
tagName: ${{ github.ref_name }}
releaseName: Splitwave ${{ github.ref_name }}
releaseDraft: true
prerelease: ${{ contains(github.ref_name, '-rc') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') }}
args: --bundles nsis