-
Notifications
You must be signed in to change notification settings - Fork 313
261 lines (240 loc) · 10.5 KB
/
Copy pathrelease-linux-egui.yml
File metadata and controls
261 lines (240 loc) · 10.5 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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
name: Release Linux egui
# This workflow deliberately has no automatic tag trigger until real Ubuntu
# audio, focus/input, install, upgrade, and rollback evidence is recorded. It is
# already reusable by a release orchestrator: pass release_tag to upload verified packages.
on:
workflow_dispatch:
inputs:
release_tag:
description: Existing GitHub release tag to receive Linux assets; blank only uploads Actions artifacts
required: false
type: string
workflow_call:
inputs:
release_tag:
required: false
type: string
secrets:
LINUX_EGUI_MINISIGN_SECRET_KEY:
required: false
permissions:
contents: write
jobs:
build-linux-egui:
runs-on: ubuntu-22.04
env:
RELEASE_TAG: ${{ inputs.release_tag }}
steps:
- uses: actions/checkout@v4
with:
submodules: false
- name: Install native build and packaging dependencies
run: |
sudo add-apt-repository -y universe || true
sudo apt-get update
sudo apt-get install -y \
appstream \
build-essential \
cmake \
desktop-file-utils \
extra-cmake-modules \
fcitx5-modules-dev \
file \
fuse \
libasound2-dev \
libdbus-1-dev \
libfcitx5config-dev \
libfcitx5core-dev \
libfcitx5utils-dev \
libopenblas-dev \
libssl-dev \
libwayland-dev \
libx11-dev \
libxkbcommon-dev \
patchelf \
pkg-config \
ripgrep \
rpm \
ruby-dev \
wget
sudo gem install --no-document fpm -v 1.16.0
- name: Install appimagetool
env:
APPIMAGETOOL_SHA256: b90f4a8b18967545fda78a445b27680a1642f1ef9488ced28b65398f2be7add2
run: |
wget -q https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage \
-O /tmp/appimagetool
echo "$APPIMAGETOOL_SHA256 /tmp/appimagetool" | sha256sum --check --strict
chmod +x /tmp/appimagetool
sudo install -m 0755 /tmp/appimagetool /usr/local/bin/appimagetool
file /usr/local/bin/appimagetool | grep -q ELF
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache Cargo
uses: swatinem/rust-cache@v2
with:
workspaces: 'openless-all/app -> target'
- name: Build fcitx5 plugin
working-directory: openless-all/scripts/linux-fcitx5-plugin
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
cmake --build build --parallel
ctest --test-dir build --output-on-failure
test -s build/libopenless.so
test -s build/openless.conf
- name: Checkout pinned Qwen ASR runtime source
run: git submodule update --init --depth 1 -- openless-all/app/src-tauri/vendor/qwen-asr
- name: Build portable Qwen ASR runtime
working-directory: openless-all/app/src-tauri/vendor/qwen-asr
run: |
make blas CFLAGS_BASE="-Wall -Wextra -O3 -ffast-math -mtune=generic"
test -x qwen_asr
./qwen_asr --help >/dev/null 2>&1
- name: Verify framework-independent Linux contract
working-directory: openless-all/app
shell: pwsh
run: |
cargo test --locked -p openless-core
cargo clippy --locked -p openless-core --all-targets -- -D warnings
cargo test --locked -p openless-linux-egui --all-targets
cargo check --locked -p openless-linux-egui --all-targets
./scripts/check-core-deps.ps1
./scripts/check-core-deps.ps1 openless-linux-egui
./scripts/check-core-secret-surface.ps1
./scripts/check-core-test-isolation.ps1
./scripts/check-core-runtime-seam.ps1
./scripts/check-linux-public-surface.ps1
- name: Validate release target and UI gate
shell: bash
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
if [ -z "${RELEASE_TAG:-}" ]; then
exit 0
fi
case "$RELEASE_TAG" in
v*-tauri) ;;
*)
echo "::error::release_tag must name an existing v*-tauri release"
exit 1
;;
esac
if grep -q 'openless-linux-egui host stub' openless-all/app/linux-egui/src/main.rs; then
echo "::error::The egui UI stub cannot be uploaded as a release asset"
exit 1
fi
gh release view "$RELEASE_TAG" --repo "$GITHUB_REPOSITORY" >/dev/null
- name: Validate Linux desktop metadata
run: |
desktop-file-validate openless-all/app/linux-egui/packaging/openless.desktop
appstreamcli validate --no-net openless-all/app/linux-egui/packaging/top.openless.OpenLess.metainfo.xml
- name: Build Linux egui host
working-directory: openless-all/app
run: cargo build --locked --release -p openless-linux-egui
- name: Resolve package version
id: version
shell: bash
working-directory: openless-all/app
run: |
if [ -n "${RELEASE_TAG:-}" ]; then
VERSION=${RELEASE_TAG#v}
VERSION=${VERSION%-tauri}
else
VERSION=$(sed -n 's/^version = "\([^"]*\)"/\1/p' src-tauri/Cargo.toml | head -1)
fi
test -n "$VERSION"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
- name: Package deb, rpm, and AppImage without Tauri
working-directory: openless-all/app
env:
OPENLESS_LINUX_VERSION: ${{ steps.version.outputs.version }}
OPENLESS_LINUX_ARCH: x86_64
APPIMAGE_EXTRACT_AND_RUN: '1'
run: bash scripts/package-linux-egui.sh
- name: Verify package contents and ELF dependencies
working-directory: openless-all/app
run: |
OUTPUT=target/linux-egui-packages
test "$(find "$OUTPUT" -maxdepth 1 -name '*.deb' | wc -l)" -eq 1
test "$(find "$OUTPUT" -maxdepth 1 -name '*.rpm' | wc -l)" -eq 1
test "$(find "$OUTPUT" -maxdepth 1 -name '*.AppImage' | wc -l)" -eq 1
! ldd target/release/openless-linux-egui | grep -q 'not found'
! ldd target/release/openless-linux-egui | grep -Eqi 'webkit|wry|tauri'
! ldd src-tauri/vendor/qwen-asr/qwen_asr | grep -q 'not found'
dpkg-deb -c "$OUTPUT"/*.deb | grep -q 'usr/bin/openless'
dpkg-deb -c "$OUTPUT"/*.deb | grep -q 'fcitx5/libopenless.so'
dpkg-deb -c "$OUTPUT"/*.deb | grep -q 'usr/lib/openless/resources/qwen-asr/qwen_asr'
rpm -qlp "$OUTPUT"/*.rpm | grep -q '/usr/bin/openless'
rpm -qlp "$OUTPUT"/*.rpm | grep -q '/usr/lib64/fcitx5/libopenless.so'
rpm -qlp "$OUTPUT"/*.rpm | grep -q '/usr/lib/openless/resources/qwen-asr/qwen_asr'
"$OUTPUT"/*.AppImage --appimage-extract >/dev/null
test -x squashfs-root/usr/bin/openless
test -s squashfs-root/usr/lib/openless/resources/linux-fcitx5-plugin/libopenless.so
test -x squashfs-root/usr/lib/openless/resources/qwen-asr/qwen_asr
! ldd squashfs-root/usr/lib/openless/resources/qwen-asr/qwen_asr | grep -q 'not found'
squashfs-root/usr/lib/openless/resources/qwen-asr/qwen_asr --help >/dev/null 2>&1
rm -rf squashfs-root
- name: Sign AppImage and write independent updater manifest
working-directory: openless-all/app
env:
MINISIGN_SECRET: ${{ secrets.LINUX_EGUI_MINISIGN_SECRET_KEY }}
VERSION: ${{ steps.version.outputs.version }}
run: |
OUTPUT=target/linux-egui-packages
APPIMAGE=$(find "$OUTPUT" -maxdepth 1 -name '*.AppImage' -print -quit)
if [ -n "${RELEASE_TAG:-}" ] && [ -z "${MINISIGN_SECRET:-}" ]; then
echo "::error::LINUX_EGUI_MINISIGN_SECRET_KEY is required for release upload"
exit 1
fi
if [ -n "${MINISIGN_SECRET:-}" ]; then
if ! command -v minisign >/dev/null 2>&1; then
cargo install --locked --version 0.9.1 minisign
fi
printf '%s' "$MINISIGN_SECRET" > "$RUNNER_TEMP/linux-egui.minisign.key"
minisign -S -s "$RUNNER_TEMP/linux-egui.minisign.key" -m "$APPIMAGE" -x "$APPIMAGE.minisig"
fi
SHA256=$(sha256sum "$APPIMAGE" | cut -d' ' -f1)
ASSET=$(basename "$APPIMAGE")
RELEASE_REPOSITORY="${GITHUB_REPOSITORY:-Open-Less/openless}"
SIGNATURE=null
if [ -f "$APPIMAGE.minisig" ]; then
SIGNATURE=$(base64 -w0 "$APPIMAGE.minisig" | jq -R .)
fi
jq -n \
--arg version "$VERSION" \
--arg url "https://github.com/$RELEASE_REPOSITORY/releases/download/${RELEASE_TAG:-manual}/$ASSET" \
--arg sha256 "$SHA256" \
--argjson signature "$SIGNATURE" \
'{schemaVersion:1, host:"linux-egui", arch:"x86_64", version:$version, url:$url, sha256:$sha256, minisign:$signature}' \
> "$OUTPUT/latest-linux-egui-x86_64.json"
- name: Verify Linux updater manifest matches the artifact
working-directory: openless-all/app
run: |
set -euo pipefail
OUTPUT=target/linux-egui-packages
APPIMAGE=$(find "$OUTPUT" -maxdepth 1 -name '*.AppImage' -print -quit)
MANIFEST="$OUTPUT/latest-linux-egui-x86_64.json"
test -s "$APPIMAGE"
test -s "$MANIFEST"
SHA256=$(sha256sum "$APPIMAGE" | cut -d' ' -f1)
RELEASE_REPOSITORY="${GITHUB_REPOSITORY:-Open-Less/openless}"
jq -e \
--arg sha256 "$SHA256" \
--arg repository "$RELEASE_REPOSITORY" \
'.schemaVersion == 1 and .host == "linux-egui" and .arch == "x86_64" and .sha256 == $sha256 and (.url | startswith("https://github.com/" + $repository + "/releases/download/"))' \
"$MANIFEST" >/dev/null
- name: Upload Linux egui workflow artifacts
uses: actions/upload-artifact@v4
with:
name: openless-linux-egui-x86_64
path: openless-all/app/target/linux-egui-packages/*
if-no-files-found: error
- name: Upload Linux egui assets to existing release
if: inputs.release_tag != ''
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.release_tag }}
files: openless-all/app/target/linux-egui-packages/*
fail_on_unmatched_files: true