[CI] Use changelog-generator for release-notes

This commit is contained in:
Chris Bono
2023-11-22 14:57:30 -06:00
parent 202c318913
commit 512ec73d94
4 changed files with 61 additions and 14 deletions

View File

@@ -209,20 +209,19 @@ jobs:
- name: Install tooling for Github release
run: |
curl -sSL https://github.com/cbroglie/mustache/releases/download/v1.2.2/mustache_1.2.2_linux_amd64.tar.gz | sudo tar -C /usr/local/bin/ --no-same-owner -xzv mustache
curl -sSL -O https://github.com/spring-io/github-changelog-generator/releases/download/v0.0.8/github-changelog-generator.jar
- name: Create Github release
env:
RELEASE_NOTES_ISSUES: ${{runner.temp}}/release_notes_issues.json
RELEASE_NOTES_FILE: ${{runner.temp}}/release_notes.md5
GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
run: |
gh issue list \
--repo spring-projects/spring-pulsar \
--state all --json number,title,labels \
--search milestone:$VERSION \
--jq '{issues:map(select((.labels | length == 0) or (any(.labels[].name; startswith("automation/rlnotes")|not))) + {repo:"spring-projects/spring-pulsar"})}' \
> $RELEASE_NOTES_ISSUES
mustache $RELEASE_NOTES_ISSUES .github/rlnotes.mustache > $RELEASE_NOTES_FILE
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" \

30
.github/workflows/release-notes.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Prepare Release Notes
on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'Version to create release notes for'
required: true
type: string
jobs:
prepare_release_notes:
if: github.repository == 'spring-projects/spring-pulsar'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: spring-io/spring-gradle-build-action@v2
- name: Install tooling for Github release
run: |
curl -sSL -O https://github.com/spring-io/github-changelog-generator/releases/download/v0.0.8/github-changelog-generator.jar
- name: Create Github release
env:
RELEASE_NOTES_FILE: ${{runner.temp}}/release_notes.md5
GH_TOKEN: ${{ secrets.GH_ACTIONS_REPO_TOKEN }}
run: |
java -jar github-changelog-generator.jar \
--spring.config.location=.github/changelog-generator.yml \
$VERSION $RELEASE_NOTES_FILE
cat $RELEASE_NOTES_FILE