feat: add automated release workflow

This commit is contained in:
Daniel Volz
2025-12-28 22:50:57 +01:00
parent 6cfdeca45b
commit 57da1bb6eb
2 changed files with 44 additions and 0 deletions
+42
View File
@@ -0,0 +1,42 @@
name: Create Release
on:
push:
tags: ['v*']
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate changelog
id: changelog
run: |
# Get previous tag
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -z "$PREV_TAG" ]; then
# First release - get all commits
CHANGES=$(git log --pretty=format:"- %s" HEAD)
else
# Get commits since last tag
CHANGES=$(git log --pretty=format:"- %s" ${PREV_TAG}..HEAD)
fi
# Write to file for multiline support
echo "$CHANGES" > changelog.txt
- name: Create Release
uses: softprops/action-gh-release@v1
with:
body_path: changelog.txt
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}