Skip to content

Commit c893556

Browse files
adding automated builds
1 parent b477692 commit c893556

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/build.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build and Package .NET App
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
build:
10+
runs-on: windows-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Setup .NET
19+
uses: actions/setup-dotnet@v4
20+
with:
21+
dotnet-version: '10.0.x' # Use latest 10.x preview SDK automatically
22+
23+
- name: Restore dependencies
24+
run: dotnet restore
25+
26+
- name: Publish Windows build
27+
run: dotnet publish -c Release -r win-x64 -o publish
28+
29+
- name: Archive build output
30+
run: Compress-Archive -Path publish\* -DestinationPath win-x64.zip
31+
32+
- name: Generate changelog
33+
id: changelog
34+
run: |
35+
$previousTag=$(git describe --tags --abbrev=0 HEAD^ 2>$null || echo "")
36+
if [ -z "$previousTag" ]; then
37+
echo "## Changes since beginning" > RELEASE_NOTES.md
38+
git log --pretty=format:"- %s" >> RELEASE_NOTES.md
39+
else
40+
echo "## Changes since $previousTag" > RELEASE_NOTES.md
41+
git log $previousTag..HEAD --pretty=format:"- %s" >> RELEASE_NOTES.md
42+
fi
43+
echo "notes<<EOF" >> $GITHUB_OUTPUT
44+
cat RELEASE_NOTES.md >> $GITHUB_OUTPUT
45+
echo "EOF" >> $GITHUB_OUTPUT
46+
47+
- name: Upload Release Asset
48+
uses: softprops/action-gh-release@v1
49+
if: startsWith(github.ref, 'refs/tags/')
50+
with:
51+
files: win-x64.zip
52+
generate_release_notes: true
53+
body: ${{ steps.changelog.outputs.notes }}
54+

0 commit comments

Comments
 (0)