diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a73643f..1d3d779 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -62,43 +62,40 @@ jobs: sudo apt-get update sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev - # Cross-compile dependencies for ARM64 + # Cross-compile toolchain for ARM64 if [ "${{ matrix.platform }}" = "linux/arm64" ]; then - sudo dpkg --add-architecture arm64 - sudo apt-get update + echo "📦 安装 ARM64 交叉编译工具链..." sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - sudo apt-get install -y libgtk-3-dev:arm64 libwebkit2gtk-4.0-dev:arm64 || true + echo "✅ ARM64 工具链安装完成" + echo "⚠️ ARM64 AppImage 打包将跳过(交叉编译限制)" + touch /tmp/skip-appimage fi - # AppImage tools (always install for Linux) - sudo apt-get install -y libfuse2 + # AppImage tools (AMD64 only) + if [ "${{ matrix.platform }}" = "linux/amd64" ]; then + sudo apt-get install -y libfuse2 - # Download linuxdeploy tools with retry - if [ "${{ matrix.platform }}" = "linux/arm64" ]; then - LINUXDEPLOY_URL="https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-aarch64.AppImage" - PLUGIN_URL="https://github.com/linuxdeploy/linuxdeploy-plugin-gtk/releases/download/continuous/linuxdeploy-plugin-gtk-aarch64.AppImage" - else LINUXDEPLOY_URL="https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" PLUGIN_URL="https://github.com/linuxdeploy/linuxdeploy-plugin-gtk/releases/download/continuous/linuxdeploy-plugin-gtk-x86_64.AppImage" - fi - echo "📥 下载 linuxdeploy..." - wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=3 \ - -O /tmp/linuxdeploy "$LINUXDEPLOY_URL" || { - echo "⚠️ linuxdeploy 下载失败,AppImage 打包将跳过" - touch /tmp/linuxdeploy-failed - } + echo "📥 下载 linuxdeploy..." + wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=3 \ + -O /tmp/linuxdeploy "$LINUXDEPLOY_URL" || { + echo "⚠️ linuxdeploy 下载失败,AppImage 打包将跳过" + touch /tmp/skip-appimage + } - echo "📥 下载 linuxdeploy-plugin-gtk..." - wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=3 \ - -O /tmp/linuxdeploy-plugin-gtk "$PLUGIN_URL" || { - echo "⚠️ linuxdeploy-plugin-gtk 下载失败,AppImage 打包将跳过" - touch /tmp/linuxdeploy-failed - } + echo "📥 下载 linuxdeploy-plugin-gtk..." + wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 --tries=3 \ + -O /tmp/linuxdeploy-plugin-gtk "$PLUGIN_URL" || { + echo "⚠️ linuxdeploy-plugin-gtk 下载失败,AppImage 打包将跳过" + touch /tmp/skip-appimage + } - if [ ! -f /tmp/linuxdeploy-failed ]; then - chmod +x /tmp/linuxdeploy /tmp/linuxdeploy-plugin-gtk - echo "✅ AppImage 工具准备完成" + if [ ! -f /tmp/skip-appimage ]; then + chmod +x /tmp/linuxdeploy /tmp/linuxdeploy-plugin-gtk + echo "✅ AppImage 工具准备完成" + fi fi - name: Install Wails @@ -190,9 +187,9 @@ jobs: tar -czvf "$TARGET.tar.gz" "$TARGET" mv "$TARGET.tar.gz" ../../ - # 2. Create AppImage (skip if tools download failed) - if [ -f /tmp/linuxdeploy-failed ]; then - echo "⚠️ AppImage 工具下载失败,跳过 AppImage 打包" + # 2. Create AppImage (skip for ARM64 or if tools unavailable) + if [ -f /tmp/skip-appimage ]; then + echo "⚠️ 跳过 AppImage 打包" exit 0 fi