Skip to content

Commit c5b754a

Browse files
committed
Enhance release workflow with auto-generated notes and improved versioning
1 parent 0224c0c commit c5b754a

File tree

2 files changed

+47
-29
lines changed

2 files changed

+47
-29
lines changed

.github/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# GitHub Release Notes configuration
2+
# Siehe Doku: https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
3+
changelog:
4+
exclude:
5+
labels:
6+
- ignore-release
7+
- dependencies
8+
authors:
9+
- dependabot
10+
categories:
11+
- title: 🚀 Features
12+
labels:
13+
- feature
14+
- enhancement
15+
- title: 🐛 Bugfixes
16+
labels:
17+
- bug
18+
- fix
19+
- regression
20+
- title: 🧪 Tests
21+
labels:
22+
- test
23+
- title: 📚 Docs & Content
24+
labels:
25+
- docs
26+
- documentation
27+
- title: 🧹 Maintenance & Chore
28+
labels:
29+
- chore
30+
- refactor
31+
- cleanup
32+
- title: 🔒 Security
33+
labels:
34+
- security
35+
- title: Other Changes
36+
labels:
37+
- '*'
38+

.github/workflows/release.yml

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
needs: version
6666
runs-on: ${{ matrix.os }}
6767
strategy:
68+
fail-fast: false
6869
matrix:
6970
include:
7071
- os: windows-latest
@@ -97,8 +98,10 @@ jobs:
9798
$rid='${{ matrix.rid }}'
9899
$workspace='${{ github.workspace }}'
99100
$outDir = Join-Path $workspace (Join-Path 'publish' $rid)
100-
Write-Host "Publishing for $rid (ReleaseVersion=${{ needs.version.outputs.release_version }})"
101-
dotnet publish MailAgent/MailAgent.csproj -c Release -r $rid /p:PublishSingleFile=true /p:PublishTrimmed=false /p:SelfContained=true -o $outDir
101+
$ver='${{ needs.version.outputs.release_version }}'
102+
$commitShort = git rev-parse --short HEAD
103+
Write-Host "Publishing for $rid (ReleaseVersion=$ver, Commit=$commitShort)"
104+
dotnet publish MailAgent/MailAgent.csproj -c Release -r $rid /p:PublishSingleFile=true /p:PublishTrimmed=false /p:SelfContained=true /p:Version=$ver /p:AssemblyVersion=$ver /p:FileVersion=$ver /p:InformationalVersion="$ver+$commitShort" -o $outDir
102105
- name: Collect licenses
103106
id: collect_licenses
104107
uses: ./.github/actions/collect-licenses
@@ -184,47 +187,24 @@ jobs:
184187
uses: actions/download-artifact@v4
185188
with:
186189
path: downloaded_artifacts
187-
- name: Generate changelog
188-
id: changelog
189-
shell: bash
190-
run: |
191-
set -euo pipefail
192-
git fetch --tags --quiet
193-
tag="v${{ needs.version.outputs.release_version }}"
194-
currentCommit=$(git rev-parse "$tag" 2>/dev/null || git rev-parse HEAD)
195-
prev=$(git tag --sort=-creatordate | grep -v "^$tag$" | head -n1 || true)
196-
if [[ -z "$prev" ]]; then
197-
notes="First release."
198-
else
199-
log=$(git log "$prev".."$currentCommit" --pretty=format:'* %h %s' | head -n200)
200-
if [[ -z "$log" ]]; then
201-
notes="No commit differences from $prev."
202-
else
203-
notes=$'Changes since '$prev':\n'
204-
notes+="$log"
205-
fi
206-
fi
207-
echo "$notes" | sed ':a;N;$!ba;s/\r//g' > changelog.txt
208-
echo "changelog<<EOF" >> $GITHUB_OUTPUT
209-
cat changelog.txt >> $GITHUB_OUTPUT
210-
echo "EOF" >> $GITHUB_OUTPUT
211-
- name: Create release
190+
- name: Create release (auto-generated notes)
212191
env:
213192
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
214193
shell: bash
215194
run: |
216195
set -euo pipefail
217196
ver='${{ needs.version.outputs.release_version }}'
218197
tag="v$ver"
219-
body="${{ steps.changelog.outputs.changelog }}"
220198
files=( $(find downloaded_artifacts -type f -name '*.zip') )
221199
if [ ${#files[@]} -eq 0 ]; then echo "No ZIP files to upload" >&2; exit 1; fi
222200
checksums=$(find downloaded_artifacts -type f -name 'checksums.sha256.txt' -maxdepth 2 || true)
223201
echo "Assets: ${#files[@]} ZIP(s)"; [ -n "$checksums" ] && echo "Checksums file: $checksums"
224202
if gh release view "$tag" >/dev/null 2>&1; then
203+
echo 'Release exists: uploading/refreshing assets (notes unchanged)'
225204
gh release upload "$tag" "${files[@]}" $checksums --clobber
226205
else
227-
gh release create "$tag" "${files[@]}" $checksums --title "mail-agent v$ver" --notes "$body"
206+
echo 'Creating new release with auto-generated notes'
207+
gh release create "$tag" "${files[@]}" $checksums --title "mail-agent v$ver" --generate-notes
228208
fi
229209
- name: Upload final artifacts bundle
230210
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)