0.1.0 #276
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: ["main"] | |
tags: ["*"] | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
branches: ["*"] | |
paths-ignore: | |
- "**.md" | |
permissions: | |
contents: write | |
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: Install dependencies | |
run: | | |
dotnet restore | |
- name: Build Release | |
run: dotnet build --configuration Release --no-restore | |
# 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 --verbosity normal --configuration Release | |
pack: | |
strategy: | |
matrix: | |
rid: | |
- win-arm64 | |
- win-x86 | |
- win-x64 | |
- linux-arm64 | |
- linux-x64 | |
- osx-arm64 | |
- osx-x64 | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
permissions: | |
actions: write | |
contents: write | |
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: Set execution permission | |
if: ${{ !startsWith(matrix.rid, 'win-') }} | |
run: chmod +x ./Console/output/Console | |
- name: Rename file | |
run: | | |
FILE=$(find ./Console/output -type f -name 'Console*') | |
if [ -f "$FILE" ]; then | |
FILENAME=$(basename -- "$FILE") # Extract the file name | |
EXTENSION="${FILENAME##*.}" # Extract the file extension | |
if [ "$EXTENSION" != "$FILENAME" ]; then # Check if an extension exists | |
mv "$FILE" "./Console/output/Console-${{ matrix.rid }}.$EXTENSION" # Rename with extension | |
else | |
mv "$FILE" "./Console/output/Console-${{ matrix.rid }}" # Rename without extension | |
fi | |
fi | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: YoutubeConsole.${{ matrix.rid }} | |
path: ./Console/output | |
if-no-files-found: error | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ./Console/output/Console* | |