5353 zip -r ../cgf-propresenter-nurserymessages-${{ steps.version.outputs.full_without_prefix }}.zip .
5454 cd ..
5555
56+ - name : Generate changelog
57+ id : changelog
58+ run : |
59+ # Get the previous tag
60+ PREVIOUS_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -2 | tail -1)
61+
62+ if [ -z "$PREVIOUS_TAG" ]; then
63+ echo "No previous tag found, using first commit"
64+ PREVIOUS_TAG=$(git rev-list --max-parents=0 HEAD)
65+ fi
66+
67+ echo "Generating changelog from $PREVIOUS_TAG to ${{ github.ref_name }}"
68+
69+ # Generate changelog with commit messages
70+ CHANGELOG=$(git log $PREVIOUS_TAG..${{ github.ref_name }} --pretty=format:"- %s (%h)" --no-merges)
71+
72+ # Save changelog to file and output
73+ echo "$CHANGELOG" > changelog.txt
74+ echo "changelog<<EOF" >> $GITHUB_OUTPUT
75+ echo "$CHANGELOG" >> $GITHUB_OUTPUT
76+ echo "EOF" >> $GITHUB_OUTPUT
77+
78+ - name : Get contributors
79+ id : contributors
80+ run : |
81+ # Get list of contributors for this release
82+ PREVIOUS_TAG=$(git tag --sort=-version:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+' | head -2 | tail -1)
83+
84+ if [ -z "$PREVIOUS_TAG" ]; then
85+ PREVIOUS_TAG=$(git rev-list --max-parents=0 HEAD)
86+ fi
87+
88+ # Get unique contributors
89+ CONTRIBUTORS=$(git log $PREVIOUS_TAG..${{ github.ref_name }} --format="%aN" --no-merges | sort -u | sed 's/^/- @/' | sed 's/@copilot\[bot\]/@copilot/')
90+
91+ echo "contributors<<EOF" >> $GITHUB_OUTPUT
92+ echo "$CONTRIBUTORS" >> $GITHUB_OUTPUT
93+ echo "EOF" >> $GITHUB_OUTPUT
94+
5695 - name : Create GitHub Release
5796 uses : softprops/action-gh-release@v2
5897 with :
@@ -70,6 +109,20 @@ jobs:
70109 4. Access the application in your browser
71110
72111 See the [README](https://github.com/${{ github.repository }}/blob/${{ github.ref_name }}/README.md) for more details.
112+
113+ ---
114+
115+ ## Changelog
116+
117+ ${{ steps.changelog.outputs.changelog }}
118+
119+ ---
120+
121+ ## Acknowledgements
122+
123+ This release was made possible by the following contributors:
124+
125+ ${{ steps.contributors.outputs.contributors }}
73126 draft : false
74127 prerelease : ${{ steps.version.outputs.is_stable != 'true' }}
75128 files : |
0 commit comments