feat: Add release notes generation and Docker image information to build workflow

This commit is contained in:
William Valentin
2025-07-29 17:09:57 -07:00
parent 21dd1fc9c8
commit fd1f9a43c6

View File

@@ -14,6 +14,8 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch full history for release notes generation
- name: Install Docker
run: curl -fsSL https://get.docker.com | sh
@@ -55,3 +57,49 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=gitea-http.taildb3494.ts.net/will/thechart:buildcache
cache-to: type=registry,ref=gitea-http.taildb3494.ts.net/will/thechart:buildcache,mode=max
- name: Generate release notes
id: release_notes
if: startsWith(gitea.ref, 'refs/tags/')
run: |
# Get the current tag
CURRENT_TAG=${GITEA_REF#refs/tags/}
# Get the previous tag
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
# Generate release notes from commits
if [ -n "$PREVIOUS_TAG" ]; then
echo "## Changes from $PREVIOUS_TAG to $CURRENT_TAG" > release_notes.md
echo "" >> release_notes.md
git log --pretty=format:"- %s (%h)" $PREVIOUS_TAG..$CURRENT_TAG >> release_notes.md
else
echo "## Initial Release $CURRENT_TAG" > release_notes.md
echo "" >> release_notes.md
git log --pretty=format:"- %s (%h)" >> release_notes.md
fi
# Add Docker image information
echo "" >> release_notes.md
echo "## Docker Images" >> release_notes.md
echo "" >> release_notes.md
echo "This release includes multi-platform Docker images:" >> release_notes.md
echo "- \`gitea-http.taildb3494.ts.net/will/thechart:$CURRENT_TAG\`" >> release_notes.md
echo "- \`gitea-http.taildb3494.ts.net/will/thechart:latest\`" >> release_notes.md
# Output the release notes content for use in next step
echo "release_notes<<EOF" >> $GITEA_OUTPUT
cat release_notes.md >> $GITEA_OUTPUT
echo "EOF" >> $GITEA_OUTPUT
- name: Create Release
if: startsWith(gitea.ref, 'refs/tags/')
uses: actions/create-release@v1
env:
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
tag_name: ${{ gitea.ref_name }}
release_name: Release ${{ gitea.ref_name }}
body: ${{ steps.release_notes.outputs.release_notes }}
draft: false
prerelease: false