Skip to content

Commit 32d2a7e

Browse files
committed
ci: add workflow
1 parent 042e405 commit 32d2a7e

File tree

1 file changed

+107
-0
lines changed

1 file changed

+107
-0
lines changed

.github/workflows/build.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Build TS3AudioBot
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
7+
jobs:
8+
build_tsab:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
tsab_version: ${{ steps.get_version.outputs.tsab_version }}
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
submodules: 'recursive'
18+
19+
- name: Setup .NET
20+
uses: actions/setup-dotnet@v4
21+
with:
22+
dotnet-version: 9.0.x
23+
24+
- name: Restore dependencies
25+
run: dotnet restore
26+
27+
- name: Test
28+
run: dotnet test -c Release --verbosity normal
29+
30+
- name: Build
31+
run: dotnet publish TS3AudioBot -c Release -o publish
32+
33+
- name: Get Version
34+
id: get_version
35+
run: |
36+
TSABVERSION=$(dotnet publish/TS3AudioBot.dll -V | grep -oP 'Version: \K.*')
37+
echo "Get Version: $TSABVERSION"
38+
echo "tsab_version=$TSABVERSION" >> "$GITHUB_OUTPUT"
39+
40+
build_frontend:
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
with:
46+
fetch-depth: 0
47+
48+
- name: Setup Node.js
49+
uses: actions/setup-node@v3
50+
with:
51+
node-version: 22
52+
53+
- name: Install yarn
54+
run: npm install -g yarn
55+
56+
- name: Install dependencies
57+
run: |
58+
cd WebInterface
59+
yarn install --frozen-lockfile
60+
- name: Build
61+
run: |
62+
cd WebInterface
63+
yarn run build
64+
- name: Archive
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: webinterface
68+
path: WebInterface/dist
69+
70+
publish:
71+
needs: [ build_tsab, build_frontend ]
72+
runs-on: ubuntu-latest
73+
strategy:
74+
matrix:
75+
rid: [ "linux-x64", "linux-arm", "linux-arm64", "win-x64" ]
76+
77+
steps:
78+
- uses: actions/checkout@v4
79+
with:
80+
fetch-depth: 0
81+
submodules: 'recursive'
82+
83+
- name: Setup .NET
84+
uses: actions/setup-dotnet@v4
85+
with:
86+
dotnet-version: 8.0.x
87+
88+
- name: Publish
89+
run: |
90+
dotnet publish TS3AudioBot/TS3AudioBot.csproj \
91+
-c Release \
92+
--framework net8.0 \
93+
--self-contained \
94+
--runtime ${{ matrix.rid }} \
95+
-p:PublishSingleFile=true,IncludeNativeLibrariesForSelfExtract=true \
96+
-o publish
97+
- name: Fetch WebInterface
98+
uses: actions/download-artifact@v4
99+
with:
100+
name: webinterface
101+
path: publish/WebInterface
102+
103+
- name: Archive
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: ts3audiobot-${{ matrix.rid }}
107+
path: publish

0 commit comments

Comments
 (0)