fix: ci build with feature wgpu #2
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: Debugging Binaries | |
| on: | |
| workflow_dispatch: | |
| push: | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: "full" | |
| jobs: | |
| ci: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [windows-2022, macos-13, ubuntu-22.04] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo | |
| target | |
| key: ${{ matrix.os }} | |
| - name: Install dependencies | |
| run: | | |
| if [ "$RUNNER_OS" == "Linux" ]; then | |
| sudo apt update | |
| sudo apt install -y libgtk-3-dev mingw-w64 | |
| elif [ "$RUNNER_OS" == "macOS" ]; then | |
| cargo install cargo-bundle | |
| rustup target install aarch64-apple-darwin | |
| rustup target install x86_64-apple-darwin | |
| fi | |
| shell: bash | |
| - name: Build | |
| run: | | |
| if [ "$RUNNER_OS" == "macOS" ]; then | |
| cargo bundle --features=wgpu --target x86_64-apple-darwin | |
| cargo bundle --features=wgpu --target aarch64-apple-darwin | |
| mv target/x86_64-apple-darwin/debug/bundle/osx/Gupaxx.app Gupaxx-debug-macos-x64.app | |
| mv target/aarch64-apple-darwin/debug/bundle/osx/Gupaxx.app Gupaxx-debug-macos-arm64.app | |
| tar -cf macos.tar Gupaxx-debug-macos-arm64.app Gupaxx-debug-macos-x64.app | |
| elif [ "$RUNNER_OS" == "Linux" ]; then | |
| cargo build --target x86_64-unknown-linux-gnu --features=wgpu | |
| mv target/x86_64-unknown-linux-gnu/debug/gupaxx gupaxx-debug | |
| tar -cf linux.tar gupaxx-debug | |
| elif [ "$RUNNER_OS" == "Windows" ]; then | |
| # For very old cpu | |
| cargo build | |
| mv target/debug/gupaxx.exe gupaxx-debug.exe | |
| tar -cf windows_old_cpu.tar gupaxx-debug.exe | |
| # For normal cpu | |
| cargo build --features=wgpu | |
| mv target/debug/gupaxx.exe gupaxx-debug.exe | |
| tar -cf windows.tar gupaxx-debug.exe | |
| fi | |
| shell: bash | |
| - name: Archive (Windows) | |
| if: ${{ runner.os == 'Windows' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows | |
| path: windows.tar | |
| - name: Archive (Windows) Old CPU | |
| if: ${{ runner.os == 'Windows' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows_old_cpu | |
| path: windows_old_cpu.tar | |
| - name: Archive | |
| if: ${{ runner.os == 'macOS' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos | |
| path: macos.tar | |
| - name: Archive (Linux) | |
| if: ${{ runner.os == 'Linux' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux | |
| path: linux.tar |