From 512ec73d9493ec772e92bafc3c036bd53c1b895f Mon Sep 17 00:00:00 2001 From: Chris Bono Date: Wed, 22 Nov 2023 14:57:30 -0600 Subject: [PATCH] [CI] Use changelog-generator for release-notes --- .github/changelog-generator.yml | 23 ++++++++++++++++++++++ .github/rlnotes.mustache | 5 ----- .github/workflows/ci.yml | 17 ++++++++-------- .github/workflows/release-notes.yml | 30 +++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 14 deletions(-) create mode 100644 .github/changelog-generator.yml delete mode 100644 .github/rlnotes.mustache create mode 100644 .github/workflows/release-notes.yml diff --git a/.github/changelog-generator.yml b/.github/changelog-generator.yml new file mode 100644 index 00000000..a27fef38 --- /dev/null +++ b/.github/changelog-generator.yml @@ -0,0 +1,23 @@ +changelog: + repository: spring-projects/spring-pulsar + sections: + - title: ":star: New Features" + labels: + - "type: enhancement" + - title: ":lady_beetle: Bug Fixes" + labels: + - "type: bug" + - "type: regression" + - title: ":notebook_with_decorative_cover: Documentation" + labels: + - "type: documentation" + - title: ":hammer: Dependency Upgrades" + sort: "title" + labels: + - "type: dependency-upgrade" + issues: + ports: + - label: "status: forward-port" + bodyExpression: 'Forward port of issue #(\d+).*' + - label: "status: back-port" + bodyExpression: 'Back port of issue #(\d+).*' diff --git a/.github/rlnotes.mustache b/.github/rlnotes.mustache deleted file mode 100644 index 21831cdf..00000000 --- a/.github/rlnotes.mustache +++ /dev/null @@ -1,5 +0,0 @@ -# Issues - -{{#issues}} -{{repo}}#{{number}} {{title}} -{{/issues}} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 194ec93f..d4b06ca5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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" \ diff --git a/.github/workflows/release-notes.yml b/.github/workflows/release-notes.yml new file mode 100644 index 00000000..e53637e5 --- /dev/null +++ b/.github/workflows/release-notes.yml @@ -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