Skip to content

Commit 50468a0

Browse files
authored
Create dotnet.yml
1 parent 36a29ea commit 50468a0

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/dotnet.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build .NET Windows App
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build:
11+
name: Build on Windows
12+
runs-on: windows-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v3
17+
18+
- name: Setup .NET SDK
19+
uses: actions/setup-dotnet@v4
20+
with:
21+
dotnet-version: '8.0.x'
22+
23+
- name: Restore dependencies
24+
run: dotnet restore
25+
26+
- name: Build project
27+
run: dotnet build --no-restore --configuration Release
28+
29+
- name: Run unit tests (if any)
30+
run: dotnet test --no-build --configuration Release
31+
continue-on-error: true # Optional: allow workflow to continue even if tests fail
32+
33+
- name: Publish (portable exe)
34+
run: dotnet publish -c Release -r win-x64 --self-contained false -p:PublishSingleFile=true -o publish
35+
36+
- name: Upload published app
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: PublishedApp
40+
path: publish

0 commit comments

Comments
 (0)