🐛 修復 windows 和 linux 打包

This commit is contained in:
Minidoracat 2025-06-15 18:28:42 +08:00
parent 0008df8065
commit e53fafa8c9

View File

@ -63,6 +63,7 @@ jobs:
steps: steps:
- name: Check if platform should be built - name: Check if platform should be built
id: check_platform id: check_platform
shell: bash
run: | run: |
SHOULD_BUILD="false" SHOULD_BUILD="false"
PLATFORM_INPUT="${{ github.event.inputs.platforms }}" PLATFORM_INPUT="${{ github.event.inputs.platforms }}"
@ -107,6 +108,7 @@ jobs:
run: uv sync --dev run: uv sync --dev
- name: Cache Rust dependencies - name: Cache Rust dependencies
if: steps.check_platform.outputs.should_build == 'true'
uses: actions/cache@v4 uses: actions/cache@v4
with: with:
path: | path: |
@ -122,13 +124,18 @@ jobs:
if: ${{ steps.check_platform.outputs.should_build == 'true' && matrix.os == 'ubuntu-latest' }} if: ${{ steps.check_platform.outputs.should_build == 'true' && matrix.os == 'ubuntu-latest' }}
run: | run: |
sudo apt-get update sudo apt-get update
# 安裝基本依賴
sudo apt-get install -y \ sudo apt-get install -y \
libwebkit2gtk-4.1-dev \ libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \ librsvg2-dev \
patchelf \ patchelf \
libgtk-3-dev \ libgtk-3-dev
libayatana-appindicator3-dev
# 嘗試安裝 ayatana-appindicator如果失敗則使用傳統的 appindicator
if ! sudo apt-get install -y libayatana-appindicator3-dev; then
echo "⚠️ libayatana-appindicator3-dev 安裝失敗,嘗試使用 libappindicator3-dev"
sudo apt-get install -y libappindicator3-dev
fi
- name: Build desktop application for ${{ matrix.name }} - name: Build desktop application for ${{ matrix.name }}
if: steps.check_platform.outputs.should_build == 'true' if: steps.check_platform.outputs.should_build == 'true'