Update dotnet.yml #222
Workflow file for this run
This file contains 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: .NET | |
on: | |
push: | |
branches: ["*"] | |
tags: ["*"] | |
pull_request: | |
branches: ["*"] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
rid: | |
- win-x64 | |
- linux-x64 | |
- osx-arm64 | |
runs-on: ${{ startsWith(matrix.rid, 'win-') && 'windows-latest' || startsWith(matrix.rid, 'osx-') && 'macos-latest' || 'ubuntu-latest' }} | |
timeout-minutes: 10 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Build | |
run: dotnet build -r ${{ matrix.rid }} | |
- name: Move file for mac | |
if: runner.os == 'MacOS' | |
run: | | |
mv ./Console/bin/Debug/net8.0/libportaudio.dylib ./Tests/bin/Debug/net8.0/libportaudio.dylib | |
# Platform-specific custom steps | |
- name: Set up PulseAudio (Linux only) | |
if: matrix.rid == 'linux-x64' | |
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 | |
- name: Test | |
run: dotnet test --no-build --verbosity normal | |
pack: | |
strategy: | |
matrix: | |
rid: | |
- win-arm64 | |
- win-x86 | |
- win-x64 | |
- linux-arm64 | |
- linux-x64 | |
- 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: Publish | |
run: cd Console && dotnet publish -c Release --runtime ${{ matrix.rid }} -o ./output | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: YoutubeConsole.${{ matrix.rid }} | |
path: ./Console/output | |
if-no-files-found: error | |