|
25 | 25 | echo "version=$VERSION" >> $GITHUB_OUTPUT |
26 | 26 | echo "Generated version: $VERSION" |
27 | 27 |
|
| 28 | + - name: Generate changelog |
| 29 | + id: changelog |
| 30 | + run: | |
| 31 | + # Get the latest tag (if exists) |
| 32 | + LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") |
| 33 | +
|
| 34 | + if [ -z "$LATEST_TAG" ]; then |
| 35 | + # No previous tag, get all commits |
| 36 | + COMMITS=$(git log --pretty=format:"- %s (%h)" --no-merges) |
| 37 | + CONTRIBUTORS=$(git log --pretty=format:"%an" --no-merges | sort -u) |
| 38 | + else |
| 39 | + # Get commits since last tag |
| 40 | + COMMITS=$(git log ${LATEST_TAG}..HEAD --pretty=format:"- %s (%h)" --no-merges) |
| 41 | + CONTRIBUTORS=$(git log ${LATEST_TAG}..HEAD --pretty=format:"%an" --no-merges | sort -u) |
| 42 | + fi |
| 43 | +
|
| 44 | + # Format contributors with @ prefix for GitHub mentions |
| 45 | + FORMATTED_CONTRIBUTORS="" |
| 46 | + while IFS= read -r author; do |
| 47 | + if [ ! -z "$author" ]; then |
| 48 | + FORMATTED_CONTRIBUTORS="${FORMATTED_CONTRIBUTORS}- ${author}\n" |
| 49 | + fi |
| 50 | + done <<< "$CONTRIBUTORS" |
| 51 | +
|
| 52 | + # Save commits to output (handle multiline) |
| 53 | + echo "commits<<EOF" >> $GITHUB_OUTPUT |
| 54 | + echo "$COMMITS" >> $GITHUB_OUTPUT |
| 55 | + echo "EOF" >> $GITHUB_OUTPUT |
| 56 | +
|
| 57 | + # Save contributors to output (handle multiline) |
| 58 | + echo "contributors<<EOF" >> $GITHUB_OUTPUT |
| 59 | + echo -e "$FORMATTED_CONTRIBUTORS" >> $GITHUB_OUTPUT |
| 60 | + echo "EOF" >> $GITHUB_OUTPUT |
| 61 | +
|
| 62 | + echo "Previous tag: ${LATEST_TAG:-none}" |
| 63 | + echo "Commits since last release:" |
| 64 | + echo "$COMMITS" |
| 65 | + echo "" |
| 66 | + echo "Contributors:" |
| 67 | + echo -e "$FORMATTED_CONTRIBUTORS" |
| 68 | +
|
28 | 69 | - name: Set up Docker Buildx |
29 | 70 | uses: docker/setup-buildx-action@v3 |
30 | 71 |
|
@@ -72,9 +113,13 @@ jobs: |
72 | 113 | tag_name: ${{ steps.version.outputs.version }} |
73 | 114 | name: Release ${{ steps.version.outputs.version }} |
74 | 115 | body: | |
75 | | - ## Changes |
76 | | - - Built from commit: ${{ github.sha }} |
77 | | - - Automatic release triggered by push to main |
| 116 | + ## Commits |
| 117 | + ${{ steps.changelog.outputs.commits }} |
| 118 | +
|
| 119 | + ## Contributors |
| 120 | + Thanks to everyone who contributed to this release! :heart: |
| 121 | +
|
| 122 | + ${{ steps.changelog.outputs.contributors }} |
78 | 123 |
|
79 | 124 | ## Docker Images |
80 | 125 | Docker images are available on Docker Hub with this version tag: |
|
0 commit comments