Skip to content

Commit

Permalink
Use changelog generator Github action
Browse files Browse the repository at this point in the history
This replaces the manual steps to generator the release changelog
in the release workflow to use the standard changelog generator
action.

Resolves #856
  • Loading branch information
onobc committed Feb 19, 2025
1 parent de5fae3 commit 2e9d9fe
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 41 deletions.
26 changes: 0 additions & 26 deletions .github/changelog-generator.yml

This file was deleted.

37 changes: 22 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,23 +189,30 @@ jobs:
echo "Tagging $REPO@$VERSION release."
git tag v$VERSION
git push --tags origin
- name: Install tooling for Github release
- name: Changelog Config File
run: |
curl -sSL -O https://github.com/spring-io/github-changelog-generator/releases/download/v0.0.10/github-changelog-generator.jar
- name: Create Github release
env:
RELEASE_NOTES_FILE: ${{runner.temp}}/release_notes.md5
GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
repositoryTeam=$(gh api repos/$GITHUB_REPOSITORY/collaborators --jq 'map(select(.role_name == "admin") | .login) | tostring')
repositoryTeam=$(sed 's/"//g' <<< ${repositoryTeam:1:-1})
repositoryVisibility=$(gh repo view --json visibility --jq .[])
repositoryVisibility=$([[ $repositoryVisibility = 'PUBLIC' ]] && echo 'true' || echo 'false')
echo "changelog.contributors.exclude.names=$repositoryTeam" > changelog.properties
echo "changelog.issues.generate-links=$repositoryVisibility" >> changelog.properties
- name: Generate Changelog
uses: spring-io/github-changelog-generator@v0.0.11
with:
milestone: ${{ env.VERSION }}
token: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
config-file: changelog.properties
- name: GitHub Release
run: |
RELEASE_URL=$(gh release create v${{ env.VERSION }} -F changelog.md ${{ (contains(env.VERSION, '-M') || contains(env.VERSION, '-RC')) && '--prerelease' || '' }})
echo "::notice title=Release Page::$RELEASE_URL"
- name: Close Milestone
run: |
java -jar github-changelog-generator.jar \
--spring.config.location=.github/changelog-generator.yml \
$VERSION $RELEASE_NOTES_FILE
cat $RELEASE_NOTES_FILE
gh release create v$VERSION \
--draft \
--title "Spring Pulsar $VERSION" \
--generate-notes \
--notes-file $RELEASE_NOTES_FILE
MILESTONE_ID=$(gh api repos/$GITHUB_REPOSITORY/milestones --jq '.[] | select(.title == "${{ env.VERSION }}") | .number')
if [ $MILESTONE_ID ]; then
gh api -X PATCH repos/$GITHUB_REPOSITORY/milestones/$MILESTONE_ID -f state='closed' --silent
fi
- name: Announce Release in Chat
if: env.GCHAT_WEBHOOK_URL
run: |
Expand Down

0 comments on commit 2e9d9fe

Please sign in to comment.