CI: fix panel builds (webkit2gtk-4.1, EventToken.h case, re-release)
All checks were successful
Release / build (push) Successful in 2m44s

- Ubuntu 24.04 (Noble) dropped webkit2gtk-4.0; install 4.1 and symlink
  the pkg-config file so webview_go finds it
- MinGW ships eventtoken.h (lowercase) but WebView2.h includes
  EventToken.h; create case-correct symlink for Linux cross-compilation
- Delete existing Gitea release before creating new one (re-release)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Axel Meyer
2026-03-03 22:16:49 +01:00
parent 9a2cec8e21
commit 28d9ff6f54

View File

@@ -24,7 +24,24 @@ jobs:
- name: Install build tools
run: |
apt-get update
apt-get install -y gcc g++ mingw-w64 zip libwebkit2gtk-4.0-dev || apt-get install -y gcc g++ mingw-w64 zip
# Noble (24.04) dropped webkit2gtk-4.0; install 4.1 and alias it
apt-get install -y gcc g++ mingw-w64 zip \
libwebkit2gtk-4.1-dev || apt-get install -y gcc g++ mingw-w64 zip
# webview_go hardcodes pkg-config webkit2gtk-4.0 — symlink 4.1 → 4.0
PKG_DIR=$(pkg-config --variable=pcfiledir webkit2gtk-4.1 2>/dev/null || echo "")
if [ -n "$PKG_DIR" ] && [ ! -f "$PKG_DIR/webkit2gtk-4.0.pc" ]; then
ln -s "$PKG_DIR/webkit2gtk-4.1.pc" "$PKG_DIR/webkit2gtk-4.0.pc"
echo "Created webkit2gtk-4.0.pc symlink → 4.1"
fi
- name: Fix MinGW header case
run: |
# MinGW ships eventtoken.h (lowercase) but WebView2.h includes EventToken.h
MINGW_INC=/usr/x86_64-w64-mingw32/include
if [ -f "$MINGW_INC/eventtoken.h" ] && [ ! -f "$MINGW_INC/EventToken.h" ]; then
ln -s "$MINGW_INC/eventtoken.h" "$MINGW_INC/EventToken.h"
echo "Created EventToken.h symlink"
fi
- name: Install nfpm
run: |
@@ -36,13 +53,13 @@ jobs:
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o syncwarden ./cmd/syncwarden
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o syncwarden-setup ./cmd/setup
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o syncwarden-panel ./cmd/panel || echo "WARN: Linux panel build skipped (missing webkit2gtk-dev)"
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o syncwarden-panel ./cmd/panel || echo "WARN: Linux panel build skipped"
- name: Build Windows binaries
run: |
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w -H=windowsgui" -o syncwarden.exe ./cmd/syncwarden
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o syncwarden-setup.exe ./cmd/setup
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build -trimpath -ldflags="-s -w -H=windowsgui" -o syncwarden-panel.exe ./cmd/panel || echo "WARN: Windows panel build skipped (missing mingw-w64)"
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build -trimpath -ldflags="-s -w -H=windowsgui" -o syncwarden-panel.exe ./cmd/panel || echo "WARN: Windows panel build skipped"
- name: Build .deb package
run: |
@@ -77,6 +94,16 @@ jobs:
API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
TAG="${GITHUB_REF_NAME}"
# Delete existing release for this tag (re-release support)
EXISTING=$(curl -s "${API}/releases/tags/${TAG}" \
-H "Authorization: token ${TOKEN}" \
| grep -o '"id":[0-9]*' | grep -m1 -o '[0-9]*')
if [ -n "$EXISTING" ]; then
curl -s -X DELETE "${API}/releases/${EXISTING}" \
-H "Authorization: token ${TOKEN}"
echo "Deleted existing release ${EXISTING} for ${TAG}"
fi
RELEASE_ID=$(curl -s -X POST "${API}/releases" \
-H "Authorization: token ${TOKEN}" \
-H "Content-Type: application/json" \