chore: 停止追踪总结文档与技术文章并更新忽略列表 #64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 多平台自动构建打包 | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| env: | |
| PROJECT_NAME: bevy_card_battler | |
| DISPLAY_NAME: 九界:渡劫 | |
| jobs: | |
| # ==================== Windows 构建 ==================== | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: 安装 Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: 编译 Release | |
| run: cargo build --release | |
| - name: 准备打包目录 | |
| shell: bash | |
| run: | | |
| mkdir -p build_dist | |
| cp target/release/${{ env.PROJECT_NAME }}.exe build_dist/ | |
| cp -r assets build_dist/ | |
| - name: 安装打包工具 (cargo-wix) | |
| if: matrix.os == 'windows-latest' | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-wix | |
| - name: 构建 Windows MSI 安装包 | |
| if: matrix.os == 'windows-latest' | |
| shell: powershell | |
| run: | | |
| # 确保 WiX 路径在环境路径中 (GitHub Runner 默认路径) | |
| $env:PATH += ";C:\Program Files (x86)\WiX Toolset v3.11\bin" | |
| cargo wix init | |
| cargo wix --no-build | |
| if (Test-Path "target/wix/*.msi") { | |
| cp target/wix/*.msi build_dist/ | |
| } | |
| - name: 上传 Windows 产物 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bevy_card_battler_windows | |
| path: build_dist/ | |
| # ==================== macOS 构建 ==================== | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: 安装 Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: 编译 Release | |
| # 此时 Cargo.toml 已移除 x11,不会再触发 -lasound 链接 | |
| run: cargo build --release | |
| - name: 准备 App Bundle | |
| shell: bash | |
| run: | | |
| APP_NAME="${{ env.DISPLAY_NAME }}" | |
| mkdir -p "build_dist/${APP_NAME}.app/Contents/MacOS" | |
| mkdir -p "build_dist/${APP_NAME}.app/Contents/Resources" | |
| cp target/release/${{ env.PROJECT_NAME }} "build_dist/${APP_NAME}.app/Contents/MacOS/" | |
| cp -r assets "build_dist/${APP_NAME}.app/Contents/Resources/" | |
| [ -f assets/icons/icon.icns ] && cp assets/icons/icon.icns "build_dist/${APP_NAME}.app/Contents/Resources/AppIcon.icns" | |
| # 创建 Info.plist | |
| cat > "build_dist/${APP_NAME}.app/Contents/Info.plist" <<EOF | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>CFBundleExecutable</key> | |
| <string>${{ env.PROJECT_NAME }}</string> | |
| <key>CFBundleIconFile</key> | |
| <string>AppIcon.icns</string> | |
| <key>CFBundleIdentifier</key> | |
| <string>com.peterfei.bevy-card-battler</string> | |
| <key>CFBundleName</key> | |
| <string>${{ env.DISPLAY_NAME }}</string> | |
| <key>CFBundlePackageType</key> | |
| <string>APPL</string> | |
| <key>LSMinimumSystemVersion</key> | |
| <string>10.12</string> | |
| </dict> | |
| </plist> | |
| EOF | |
| - name: 上传 macOS 产物 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bevy_card_battler_macos | |
| path: build_dist/ | |
| # ==================== Linux 构建 ==================== | |
| build-linux: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: 安装 Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: 安装依赖 | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y g++ pkg-config libx11-dev libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev | |
| - name: 编译 Release | |
| run: cargo build --release | |
| - name: 准备打包目录 | |
| shell: bash | |
| run: | | |
| mkdir -p build_dist | |
| cp target/release/${{ env.PROJECT_NAME }} build_dist/ | |
| cp -r assets build_dist/ | |
| - name: 上传 Linux 产物 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bevy_card_battler_linux | |
| path: build_dist/ |