From 69e2f48d13a0853abbe425e779f165266c1ca638 Mon Sep 17 00:00:00 2001 From: Carlos Quintana Date: Thu, 12 May 2022 10:51:57 +0200 Subject: [PATCH 1/2] Try to generate release notes --- .github/changelog_configuration.json | 23 ++++++++++++++++++ .github/workflows/main.yml | 36 +++++++++++++++++++++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .github/changelog_configuration.json diff --git a/.github/changelog_configuration.json b/.github/changelog_configuration.json new file mode 100644 index 00000000..030fcd6a --- /dev/null +++ b/.github/changelog_configuration.json @@ -0,0 +1,23 @@ +{ + "template": "${{CHANGELOG}}", + "pr_template": "- ${{TITLE}}\n - PR: #${{NUMBER}}", + "empty_template": "- no changes", + "categories": [ + { + "title": "## 🚀 Features", + "labels": ["feature"] + }, + { + "title": "## 🐛 Fixes", + "labels": ["fix", "bug"] + }, + { + "title": "## \uD83D\uDD27 Enhancements", + "labels": ["enhancement"] + } + ], + "ignore_labels": ["ignore"], + "tag_resolver": { + "method": "sort" + } +} \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c0a6beb7..74cd7ce0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -138,10 +138,44 @@ jobs: token: ${{ secrets.TELEGRAM_TOKEN }} args: Docker image pushed on ${{ github.ref }} + # If we have generated a tag, generate the changelog, send a notification to slack and create the GitHub release + - name: Build Changelog + id: build_changelog + if: startsWith(github.ref, 'refs/tags/v') + uses: mikepenz/release-changelog-builder-action@v3 + with: + configuration: ".github/changelog_configuration.json" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Post notification to Slack uses: slackapi/slack-github-action@v1.19.0 + if: startsWith(github.ref, 'refs/tags/v') with: channel-id: ${{ secrets.SLACK_CHANNEL_ID }} - slack-message: "New tag generated: ${{github.ref}}\nBuild result: ${{ job.status }}" + payload: | + { + "text": "New tag generated: ${{github.ref}}\nBuild result: ${{ job.status }}", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "New tag generated: ${{github.ref}}\nBuild result: ${{ job.status }}\nChangelog:\n${{ steps.build_changelog.outputs.changelog }}" + } + } + ] + } + slack-message: "" env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + + - name: Create GitHub Release + if: startsWith(github.ref, 'refs/tags/v') + uses: actions/create-release@v1 + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + body: ${{ steps.build_changelog.outputs.changelog }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 7b71eab5d44169302522b0cfe083231c8901e1b8 Mon Sep 17 00:00:00 2001 From: Carlos Quintana <74399022+cquintana92@users.noreply.github.com> Date: Thu, 12 May 2022 12:17:27 +0200 Subject: [PATCH 2/2] Update .github/changelog_configuration.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Adrià Casajús --- .github/changelog_configuration.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/changelog_configuration.json b/.github/changelog_configuration.json index 030fcd6a..eac82331 100644 --- a/.github/changelog_configuration.json +++ b/.github/changelog_configuration.json @@ -12,7 +12,7 @@ "labels": ["fix", "bug"] }, { - "title": "## \uD83D\uDD27 Enhancements", + "title": "## 🔧 Enhancements", "labels": ["enhancement"] } ],