CI: replace release drafter action with release.yml

This commit is contained in:
marco 2025-05-06 11:55:20 +02:00
parent f8f0b2a211
commit 2f2f4cac4c
3 changed files with 58 additions and 21 deletions

27
.github/release.yml vendored Normal file
View file

@ -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:
- "*"

View file

@ -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 }}

View file

@ -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<<EOF" >> $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 <a href=\"https://www.maxmind.com\">https://www.maxmind.com</a>.\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 }}