From aab6fb81bbab5ef4b9920fc9a39f6379e04ec8ac Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 15 Mar 2022 11:40:26 +0100 Subject: [PATCH] Add PR template and changelog generator Signed-off-by: Chris --- .github/PULL_REQUEST_TEMPLATE.md | 16 ++++++++++++++ .github/changelog-configuration.json | 30 ++++++++++++++++++++++++++ .github/workflows/release.yml | 32 ++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/changelog-configuration.json create mode 100644 .github/workflows/release.yml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..6f80ec4a --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Summary + + +## Checklist + +- [ ] Try to isolate changes into separate PRs (to build a better changelog). +- [ ] Categorize the PR by setting a good title and adding one of the labels: + `change`, `decision`, `requirement/quality`, `requirement/functional`, `dependency` + as they show up in the changelog +- [ ] Link this PR to related issues if applicable. + + diff --git a/.github/changelog-configuration.json b/.github/changelog-configuration.json new file mode 100644 index 00000000..1a26345b --- /dev/null +++ b/.github/changelog-configuration.json @@ -0,0 +1,30 @@ +{ + "pr_template": "- ${{TITLE}} (#${{NUMBER}})", + "categories": [ + { + "title": "## โš–๏ธ Decisions", + "labels": ["decision"] + }, + { + "title": "## ๐Ÿ“• Tutorials", + "labels": ["tutorial"] + }, + { + "title": "## ๐Ÿงพ Quality Requirements", + "labels": ["requirement/quality"] + }, + { + "title": "## ๐Ÿ“„ Functional Requirements", + "labels": ["requirement/functional"] + }, + { + "title": "## ๐Ÿ› ๏ธ Minor Changes", + "labels": ["change"] + }, + { + "title": "## ๐Ÿ”— Dependency Updates", + "labels": ["dependency"] + } + ], + "template": "${{CATEGORIZED_COUNT}} changes since ${{FROM_TAG}}\n\n${{CHANGELOG}}" +} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..97630f5a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Release +on: + push: + tags: + - v* + +jobs: + dist: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: "0" + - name: Build changelog from PRs with labels + id: build_changelog + uses: mikepenz/release-changelog-builder-action@v2 + with: + configuration: ".github/changelog-configuration.json" + # PreReleases still get a changelog, but the next full release gets a diff since the last full release, + # combining possible changelogs of all previous PreReleases in between. + # PreReleases show a partial changelog since last PreRelease. + ignorePreReleases: "${{ !contains(github.ref, '-rc') }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create Release + uses: ncipollo/release-action@v1 + with: + body: ${{steps.build_changelog.outputs.changelog}} + prerelease: "${{ contains(github.ref, '-rc') }}" + # Ensure target branch for release is "master" + commit: master + token: ${{ secrets.GITHUB_TOKEN }}