diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 000000000..b3197323a --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,27 @@ +# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes + +changelog: + exclude: + labels: + - ignore-for-release + categories: + - title: "New features" + labels: + - kind/feature + - title: "Packaging" + labels: + - kind/packaging + - title: "Bug fixes" + labels: + - kind/fix + - title: "Dependencies" + labels: + - kind/dependencies + authors: + - dependabot + - title: "Refactoring" + labels: + - kind/refactoring + - title: Other Changes + labels: + - "*" diff --git a/.github/workflows/ci_release-drafter.yml b/.github/workflows/ci_release-drafter.yml deleted file mode 100644 index 0b8c9b386..000000000 --- a/.github/workflows/ci_release-drafter.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Release Drafter - -on: - push: - # branches to consider in the event; optional, defaults to all - branches: - - master - - releases/** - -jobs: - update_release_draft: - runs-on: ubuntu-latest - steps: - # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v6 - with: - config-name: release-drafter.yml - # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml - # config-name: my-config.yml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/edit-release-notes.yml b/.github/workflows/edit-release-notes.yml new file mode 100644 index 000000000..d9af72e99 --- /dev/null +++ b/.github/workflows/edit-release-notes.yml @@ -0,0 +1,31 @@ +name: Customize Release Notes + +on: + release: + types: [created] + +jobs: + append-license: + runs-on: ubuntu-latest + steps: + - name: Get release notes + id: get_release + run: | + echo "release_notes<> $GITHUB_OUTPUT + gh release view ${{ github.event.release.tag_name }} \ + --repo "${{ github.repository }}" \ + --json body -q '.body' >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Append additional information + run: | + echo -e >updated_notes.md \ + "${{ steps.get_release.outputs.release_notes }}\n\n## Geolite2 notice\n\nThis product includes GeoLite2 data created by MaxMind, available from https://www.maxmind.com.\n\n## Installation\n\nTake a look at the [installation instructions](https://doc.crowdsec.net/docs/getting_started/install_crowdsec)." + gh release edit "${{ github.event.release.tag_name }}" \ + --repo "${{ github.repository }}" \ + --notes-file updated_notes.md + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} +