mirror of
https://github.com/Novattz/creamlinux-installer.git
synced 2026-08-01 19:18:25 -04:00
131 lines
4.3 KiB
YAML
131 lines
4.3 KiB
YAML
name: 'Test Build'
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-tauri:
|
|
permissions:
|
|
contents: write
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- platform: 'ubuntu-24.04'
|
|
args: ''
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
cache: 'npm'
|
|
|
|
- name: Install Rust stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
components: rustfmt, clippy
|
|
|
|
- name: Rust cache
|
|
uses: swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: './src-tauri -> target'
|
|
|
|
- name: Install system dependencies (Ubuntu)
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libwebkit2gtk-4.1-0 \
|
|
libwebkit2gtk-4.1-dev \
|
|
libjavascriptcoregtk-4.1-0 \
|
|
libjavascriptcoregtk-4.1-dev \
|
|
gir1.2-javascriptcoregtk-4.1 \
|
|
gir1.2-webkit2-4.1 \
|
|
libappindicator3-dev \
|
|
librsvg2-dev \
|
|
patchelf \
|
|
build-essential \
|
|
curl \
|
|
wget \
|
|
file \
|
|
libssl-dev \
|
|
libgtk-3-dev
|
|
|
|
- name: Install frontend dependencies
|
|
run: npm ci
|
|
|
|
- name: Build Tauri app
|
|
run: npm run tauri build
|
|
env:
|
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
|
|
|
- name: Strip bundled GTK/WebKit/GLib stack, rely on the host's instead
|
|
run: |
|
|
set -euo pipefail
|
|
cd src-tauri/target/release/bundle/appimage
|
|
APPIMAGE=$(ls *.AppImage)
|
|
chmod +x "$APPIMAGE"
|
|
./"$APPIMAGE" --appimage-extract >/dev/null
|
|
|
|
LDCONFIG_CACHE=$(ldconfig -p)
|
|
resolve_lib_path() {
|
|
awk -v lib="$1" '$1==lib {print $NF; exit}' <<< "$LDCONFIG_CACHE"
|
|
}
|
|
|
|
# WebKitGTK bundled by the AppImage tooling is pinned to whatever the
|
|
# build image ships, and drifts out of sync with newer host systems
|
|
# (freezes on old bundled WebKit, EGL/DMABUF crashes on some newer
|
|
# ones). The only configuration that's tested clean is deferring the
|
|
# whole GTK/WebKit/GLib stack to the host's own matched libraries, so
|
|
# we compute the full dependency closure from the host side (whatever
|
|
# is actually installed here) and strip every bundled copy that's
|
|
# also part of that closure.
|
|
declare -A EXCLUDE
|
|
for seed in libwebkit2gtk-4.1.so.0 libglib-2.0.so.0 libgio-2.0.so.0 libgobject-2.0.so.0 libgmodule-2.0.so.0; do
|
|
EXCLUDE[$seed]=1
|
|
done
|
|
|
|
changed=1
|
|
while [ "$changed" -eq 1 ]; do
|
|
changed=0
|
|
for lib in "${!EXCLUDE[@]}"; do
|
|
hostpath=$(resolve_lib_path "$lib")
|
|
[ -n "$hostpath" ] && [ -e "$hostpath" ] || continue
|
|
deps=$(ldd "$hostpath" 2>/dev/null | grep -oE '[a-zA-Z0-9._+-]+\.so[0-9.]*' | sort -u) || true
|
|
for d in $deps; do
|
|
if [ -z "${EXCLUDE[$d]:-}" ]; then
|
|
if find squashfs-root/usr/lib -maxdepth 1 -name "${d}*" 2>/dev/null | grep -q .; then
|
|
EXCLUDE[$d]=1
|
|
changed=1
|
|
fi
|
|
fi
|
|
done
|
|
done
|
|
done
|
|
|
|
echo "Excluding ${#EXCLUDE[@]} bundled libraries, relying on the host's instead:"
|
|
for lib in "${!EXCLUDE[@]}"; do echo " $lib"; done | sort
|
|
|
|
for lib in "${!EXCLUDE[@]}"; do
|
|
find squashfs-root/usr/lib -maxdepth 1 -name "${lib%.so*}.so*" -delete
|
|
done
|
|
|
|
curl -sSL -o appimagetool "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
|
|
chmod +x appimagetool
|
|
rm -f "$APPIMAGE"
|
|
ARCH=x86_64 ./appimagetool --appimage-extract-and-run squashfs-root "$APPIMAGE"
|
|
rm -rf squashfs-root
|
|
|
|
- name: Upload AppImage artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: appimage
|
|
path: src-tauri/target/release/bundle/appimage/*.AppImage
|
|
if-no-files-found: error
|