-
-
Notifications
You must be signed in to change notification settings - Fork 142
140 lines (116 loc) · 3.54 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Build TS3AudioBot
on:
push:
branches: [ "master", "develop" ]
jobs:
test_tsab:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: |
dotnet build TSLibAutogen -c Release --no-restore
dotnet build -c Release --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
build_frontend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 22
- name: Install yarn
run: npm install -g yarn
- name: Install dependencies
run: |
cd WebInterface
yarn install --frozen-lockfile
- name: Build
run: |
cd WebInterface
yarn run build
- name: Archive
uses: actions/upload-artifact@v4
with:
name: webinterface
path: WebInterface/dist
publish:
needs: [ test_tsab, build_frontend ]
runs-on: ubuntu-latest
strategy:
matrix:
rid: [ linux-x64, linux-arm, linux-arm64, win-x64 ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Publish
run: |
dotnet publish TS3AudioBot\TS3AudioBot.csproj \
-c Release \
--framework net8.0 \
--self-contained \
--runtime ${{ matrix.rid }} \
-p:PublishSingleFile=true,IncludeNativeLibrariesForSelfExtract=true \
-o publish
- name: Fetch WebInterface
uses: actions/download-artifact@v4
with:
name: webinterface
path: publish/WebInterface
- name: Archive
uses: actions/upload-artifact@v4
with:
name: ts3audiobot-${{ matrix.rid }}
path: publish
- name: Install nbgv
run: dotnet tool install --global nbgv
- name: Get Version
id: get_version
run: |
cd publish
TSABVERSION=$(nbgv get-version -p TS3AudioBot -v NuGetPackageVersion)
TSABBRANCH="${{ github.head_ref || github.ref_name }}"
TASBBUILDSUFFIX=$(echo ${{ matrix.rid }} | tr '-' '_')
echo "TSABVERSION=$TSABVERSION" >> $GITHUB_ENV
echo "TSABBRANCH=$TSABBRANCH" >> $GITHUB_ENV
echo "TASBBUILD=${TSABBRANCH}_${TASBBUILDSUFFIX}" >> $GITHUB_ENV
- name: Upload to Splamy.de
if: startsWith(matrix.rid, 'win-')
run: |
cd publish
zip -r TS3AudioBot.zip .
curl \
-X PUT \
-H "Content-Type: application/zip" \
-H "Authorization: ${{ secrets.UPLOAD_TOKEN }}" \
--data-binary @TS3AudioBot.zip \
"https://splamy.de/api/nightly/projects/ts3ab/${TASBBUILD}?filename=TS3AudioBot.zip&commit=${{ github.sha }}&version=${TSABVERSION}"
- name: Upload to Splamy.de
if: startsWith(matrix.rid, 'linux-')
run: |
cd publish
chmod 755 TS3AudioBot
tar -czf TS3AudioBot.tar.gz .
curl \
-X PUT \
-H "Content-Type: application/gzip" \
-H "Authorization: ${{ secrets.UPLOAD_TOKEN }}" \
--data-binary @TS3AudioBot.tar.gz \
"https://splamy.de/api/nightly/projects/ts3ab/${TASBBUILD}?filename=TS3AudioBot.tar.gz&commit=${{ github.sha }}&version=$TSABVERSION"