Fix CI: enable cross-platform restore for multi-target project #3
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: Build Avalonia (Cross-Platform) | |
| on: | |
| push: | |
| branches: [avalonia] | |
| pull_request: | |
| branches: [avalonia] | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| rid: win-x64 | |
| artifact: EmoTracker-win-x64 | |
| - os: macos-latest | |
| rid: osx-x64 | |
| artifact: EmoTracker-osx-x64 | |
| - os: macos-latest | |
| rid: osx-arm64 | |
| artifact: EmoTracker-osx-arm64 | |
| - os: ubuntu-latest | |
| rid: linux-x64 | |
| artifact: EmoTracker-linux-x64 | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| # Allow restoring the net8.0-windows target on non-Windows (skips WPF-specific build) | |
| EnableWindowsTargeting: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET 8 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Publish | |
| run: dotnet publish EmoTracker/EmoTracker.csproj --framework net8.0 --configuration Release --runtime ${{ matrix.rid }} --self-contained --output publish/${{ matrix.artifact }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: publish/${{ matrix.artifact }} |