Skip to content

Commit 1b61099

Browse files
committed
Create a changelog.
1 parent 97a0d03 commit 1b61099

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/publish.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,35 @@ jobs:
4747
with:
4848
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
4949

50+
- id: tagLocalBuild
51+
name: "🏷️ Tag local build"
52+
run: |
53+
git config --global user.name "GitHub Actions"
54+
git config --global user.email "github@chisels-and-bits.com"
55+
git tag -f -a "${{ steps.extract-major-minor.outputs.joined }}.${{ steps.extract-patch.outputs.count }}" -m "${{ steps.extract-major-minor.outputs.joined }}.${{ steps.extract-patch.outputs.count }}"
56+
git push --tags
57+
58+
- id: getPreviousTag
59+
name: "📝 Get previous tag"
60+
run: |
61+
previous_tag=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))
62+
echo "Previous tag: ${previous_tag}"
63+
echo "previous_tag=${previous_tag}" >> "$GITHUB_OUTPUT"
64+
65+
- id: generateReleaseChangelog
66+
name: "📝 Generate release changelog"
67+
run: |
68+
echo "# Changelog" > changelog.md
69+
echo "" >> changelog.md
70+
echo "[Full Changelog](${{ github.server_url }}/${{ github.repository }}/compare/${{ steps.getPreviousTag.outputs.previous_tag }}..${{ needs.compute-version.outputs.tag_version }})" >> changelog.md
71+
echo "" >> changelog.md
72+
echo "Changelog of version: ${{ steps.extract-major-minor.outputs.joined }}"
73+
echo "### Commits:" >> changelog.md
74+
echo "" >> changelog.md
75+
echo "$(git log --pretty=format:"- %s ([commit](${{ github.server_url }}/${{ github.repository }}/commit/%H))" ${{ steps.getPreviousTag.outputs.previous_tag }}..${{ needs.compute-version.outputs.tag_version }})" >> changelog.md
76+
echo "" >> changelog.md
77+
sed -i -E "s|\(#([[:digit:]]+)\)|([#\1](${{ github.server_url }}/${{ github.repository }}/pull/\1))|" changelog.md
78+
5079
- name: Publish to Maven
5180
run: ./gradlew publish
5281
env:

0 commit comments

Comments
 (0)