From 7a0fedec0244a5e54c28dfe8f549e7a5616ece80 Mon Sep 17 00:00:00 2001 From: Mahmoud Ben Hassine Date: Tue, 28 Feb 2023 16:46:24 +0100 Subject: [PATCH] Add Github Action to generate release notes --- .../workflows/release-notes-generation.yml | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/release-notes-generation.yml diff --git a/.github/workflows/release-notes-generation.yml b/.github/workflows/release-notes-generation.yml new file mode 100644 index 000000000..fa601a05f --- /dev/null +++ b/.github/workflows/release-notes-generation.yml @@ -0,0 +1,54 @@ +name: Generate Release notes + +on: + workflow_dispatch: + inputs: + milestoneNumber: + description: "Milestone title" + required: true + generatorVersion: + description: "Changelog Generator version" + required: true + +jobs: + build: + name: Generate release notes + runs-on: ubuntu-latest + steps: + - name: Capture milestone number and generator version + run: | + echo MILESTONE_NUMBER=${{ github.event.inputs.milestoneNumber }} >> $GITHUB_ENV + echo GENERATOR_VERSION=${{ github.event.inputs.generatorVersion }} >> $GITHUB_ENV + + - name: Download changelog generator + run: wget https://github.com/spring-io/github-changelog-generator/releases/download/v$GENERATOR_VERSION/github-changelog-generator.jar + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + + - name: Prepare configuration file + run: | + cat << EOF > application.yml + changelog: + repository: spring-projects/spring-batch + sections: + - title: ":star: New features" + labels: [ "type: feature" ] + - title: ":rocket: Enhancements" + labels: [ "type: enhancement" ] + - title: ":lady_beetle: Bug fixes" + labels: [ "type: bug" ] + - title: ":notebook_with_decorative_cover: Documentation" + labels: [ "in: documentation" ] + - title: ":hammer: Tasks" + labels: [ "type: task" ] + EOF + + - name: Generate release notes + run: java -jar github-changelog-generator.jar $MILESTONE_NUMBER release-notes.md + + - name: Print release notes + run: cat release-notes.md