-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (90 loc) · 2.6 KB
/
dotnet.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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
EXTENSION="${FILE##*.}" # Extract the file extension
mv "$FILE" "./Console/output/Console-${{ matrix.rid }}.$EXTENSION" # Rename while preserving extension
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