fix(windows): fix PermissionKind out-param and add AppImage support
Build Lotus Chat Desktop / build-windows (push) Failing after 23m52s
Build Lotus Chat Desktop / build-linux (push) Has been cancelled
Build Lotus Chat Desktop / update-manifest (push) Has been cancelled

- Fix COREWEBVIEW2_PERMISSION_KIND out-param pattern in PermissionRequestedEventHandler
- Add "wry" feature to tauri dep so with_webview compiles on Windows
- Build both appimage and deb on Linux for auto-update compatibility
- Commit AppRun-x86_64 binary to avoid GitHub download timeout in CI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-10 00:06:12 -04:00
parent eadd3bfc48
commit d043f9c416
4 changed files with 36 additions and 21 deletions
+32 -19
View File
@@ -40,11 +40,9 @@ jobs:
env:
TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
# Read version from tauri.conf.json — no fragile filename parsing
$VERSION = (Get-Content "src-tauri\tauri.conf.json" | ConvertFrom-Json).version
Write-Host "Version: $VERSION"
# Get or create the latest release
$release = Invoke-RestMethod -Uri "$env:GITEA_URL/api/v1/repos/$env:REPO/releases/tags/latest" `
-Headers @{ Authorization = "token $env:TOKEN" } -ErrorAction SilentlyContinue
if (-not $release) {
@@ -63,7 +61,6 @@ jobs:
)
$names = @("LotusChat-x86_64-setup.exe", "LotusChat-x86_64-setup.nsis.zip", "LotusChat-x86_64-setup.nsis.zip.sig")
for ($i = 0; $i -lt $files.Length; $i++) {
# Delete existing asset with same name if present
$existing = (Invoke-RestMethod -Uri "$env:GITEA_URL/api/v1/repos/$env:REPO/releases/$releaseId/assets" `
-Headers @{ Authorization = "token $env:TOKEN" }) | Where-Object { $_.name -eq $names[$i] }
if ($existing) {
@@ -113,26 +110,29 @@ jobs:
- name: Install Tauri deps
run: npm ci
- name: Stage AppRun for AppImage bundler
run: |
mkdir -p ~/.cache/tauri
cp tools/AppRun-x86_64 ~/.cache/tauri/AppRun-x86_64
chmod +x ~/.cache/tauri/AppRun-x86_64
- name: Build
env:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ''
NODE_OPTIONS: '--max_old_space_size=4096'
# AppImage requires downloading AppRun from GitHub which times out in this runner.
# Build deb only; AppImage can be re-enabled once network access to GitHub is confirmed.
run: npm run tauri -- build --bundles deb
run: npm run tauri -- build --bundles appimage,deb
- name: Upload to release
env:
TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: |
# Read version from tauri.conf.json — no fragile filename parsing
VERSION=$(python3 -c "import json; print(json.load(open('src-tauri/tauri.conf.json'))['version'])")
echo "Version: $VERSION"
DEB="src-tauri/target/release/bundle/deb/Lotus Chat_${VERSION}_amd64.deb"
APPIMAGE_DIR="src-tauri/target/release/bundle/appimage"
DEB_DIR="src-tauri/target/release/bundle/deb"
# Get or create the latest release
RELEASE=$(curl -sf "$GITEA_URL/api/v1/repos/$REPO/releases/tags/latest" \
-H "Authorization: token $TOKEN" 2>/dev/null || true)
RELEASE_ID=$(echo "$RELEASE" | python3 -c "import sys,json; print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true)
@@ -144,10 +144,9 @@ jobs:
| python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
fi
for file in \
"LotusChat-x86_64.deb|$DEB"; do
name="${file%%|*}"
path="${file##*|}"
upload() {
local name="$1" path="$2"
local existing_id
existing_id=$(curl -sf "$GITEA_URL/api/v1/repos/$REPO/releases/$RELEASE_ID/assets" \
-H "Authorization: token $TOKEN" \
| python3 -c "import sys,json; assets=json.load(sys.stdin); print(next((str(a['id']) for a in assets if a['name']=='$name'), ''))" 2>/dev/null || true)
@@ -161,7 +160,12 @@ jobs:
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @"$path"
done
}
upload "LotusChat-x86_64.AppImage" "$APPIMAGE_DIR/Lotus Chat_${VERSION}_amd64.AppImage"
upload "LotusChat-x86_64.AppImage.tar.gz" "$APPIMAGE_DIR/Lotus Chat_${VERSION}_amd64.AppImage.tar.gz"
upload "LotusChat-x86_64.AppImage.tar.gz.sig" "$APPIMAGE_DIR/Lotus Chat_${VERSION}_amd64.AppImage.tar.gz.sig"
upload "LotusChat-x86_64.deb" "$DEB_DIR/Lotus Chat_${VERSION}_amd64.deb"
update-manifest:
needs: [build-windows, build-linux]
@@ -177,6 +181,7 @@ jobs:
BASE="$GITEA_URL/LotusGuild/cinny-desktop/releases/download/latest"
WIN_SIG=$(curl -sf "$BASE/LotusChat-x86_64-setup.nsis.zip.sig")
LIN_SIG=$(curl -sf "$BASE/LotusChat-x86_64.AppImage.tar.gz.sig")
RELEASE=$(curl -sf "$GITEA_URL/api/v1/repos/$REPO/releases/tags/latest" \
-H "Authorization: token $TOKEN")
@@ -187,14 +192,22 @@ jobs:
jq -n \
--arg version "$VERSION" \
--arg date "$DATE" \
--arg url "$BASE/LotusChat-x86_64-setup.nsis.zip" \
--arg sig "$WIN_SIG" \
'{"version":$version,"notes":"Latest Lotus Chat release","pub_date":$date,"platforms":{"windows-x86_64":{"url":$url,"signature":$sig}}}' \
> release.json
--arg win_url "$BASE/LotusChat-x86_64-setup.nsis.zip" \
--arg win_sig "$WIN_SIG" \
--arg lin_url "$BASE/LotusChat-x86_64.AppImage.tar.gz" \
--arg lin_sig "$LIN_SIG" \
'{
version: $version,
notes: "Latest Lotus Chat release",
pub_date: $date,
platforms: {
"windows-x86_64": { url: $win_url, signature: $win_sig },
"linux-x86_64": { url: $lin_url, signature: $lin_sig }
}
}' > release.json
cat release.json
# Delete old manifest asset if present
OLD=$(curl -sf "$GITEA_URL/api/v1/repos/$REPO/releases/$RELEASE_ID/assets" \
-H "Authorization: token $TOKEN" \
| python3 -c "import sys,json; print(next((str(a['id']) for a in json.load(sys.stdin) if a['name']=='release.json'), ''))" 2>/dev/null || true)
+1 -1
View File
@@ -17,7 +17,7 @@ tauri-build = { version = "2", features = [] }
[dependencies]
serde_json = "1.0.109"
serde = { version = "1.0.193", features = ["derive"] }
tauri = { version = "2", features = [ "devtools"] }
tauri = { version = "2", features = ["devtools", "wry"] }
tauri-plugin-localhost = "2"
tauri-plugin-window-state = "2"
tauri-plugin-clipboard-manager = "2"
+3 -1
View File
@@ -53,7 +53,9 @@ pub fn run() {
let handler = PermissionRequestedEventHandler::create(Box::new(
|_sender, args| {
if let Some(args) = args {
let kind = unsafe { args.PermissionKind() }?;
// PermissionKind uses a COM out-param pattern
let mut kind = COREWEBVIEW2_PERMISSION_KIND(0);
unsafe { args.PermissionKind(&mut kind) }?;
if kind == COREWEBVIEW2_PERMISSION_KIND_MICROPHONE
|| kind == COREWEBVIEW2_PERMISSION_KIND_CAMERA
{
BIN
View File
Binary file not shown.