diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index f9fc49d..875f609 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -9,31 +9,58 @@ on: jobs: build: - runs-on: ubuntu-latest + strategy: + matrix: + rid: + - win-arm64 + - win-x86 + - win-x64 + - linux-arm64 + - linux-x64 + - linux-x86 + - osx-arm64 + - osx-x64 + + runs-on: ${{ startsWith(matrix.rid, 'win-') && 'windows-latest' || startsWith(matrix.rid, 'osx-') && 'macos-latest' || 'ubuntu-latest' }} + timeout-minutes: 10 + + permissions: + actions: write + contents: read steps: - uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x - - name: Set up PulseAudio - run: | - sudo apt-get update - sudo apt-get install -y pulseaudio + + # OS-specific steps - name: Restore dependencies run: dotnet restore + - name: Build run: dotnet build --no-restore - - name: Test + + # Platform-specific custom steps + - name: Set up PulseAudio (Linux only) + if: runner.os == 'Linux' run: | + sudo apt-get update + sudo apt-get install -y pulseaudio pulseaudio --start pactl load-module module-null-sink sink_name=VirtualSink sink_properties=device.description=Virtual_Sink pactl set-default-sink VirtualSink - dotnet test --no-build --verbosity normal + + - name: Test + run: dotnet test --no-build --verbosity normal + - name: Publish - run: cd Console && dotnet publish -c Release -o ./output + run: cd Console && dotnet publish -c Release --runtime ${{ matrix.rid }} + - name: Upload Artifact uses: actions/upload-artifact@v4 with: name: YoutubeConsole - path: ./Console/output + path: ./Console/bin/publish + +