Add Release Drafter workflow

This commit is contained in:
Håvard Thom 2024-11-03 14:33:00 +01:00
parent 3e399bef5c
commit f6cab74b68
2 changed files with 96 additions and 0 deletions

55
.github/release-drafter.yml vendored Normal file
View File

@ -0,0 +1,55 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
template: |
## Whats Changed
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
categories:
- title: '💥 Breaking Changes'
label: 'breaking change'
- title: '✨ New Scripts'
label: 'new script'
- title: '🚀 Updated Scripts'
label: 'update script'
- title: '🐛 Bug Fixes'
label: 'bug fix'
- title: '🧰 Maintenance'
label: 'chore'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
major:
labels:
- 'breaking change'
minor:
labels:
- 'new script'
- 'update script'
patch:
labels:
- 'bug fix'
- 'chore'
default: patch
# autolabeler:
# - label: 'new script'
# title:
# - '/new script/i'
# - label: 'update script'
# title:
# - '/update script/i'
# - label: 'breaking change'
# title:
# - '/breaking change/i'
# - label: 'bug fix'
# title:
# - '/bug fix/i'
# - label: 'chore'
# files:
# - '*.md'
# - '*.yml'
# - label: 'high risk'
# files:
# - '**/build.func'
# - '**/install.func'

41
.github/workflows/release.yml vendored Normal file
View File

@ -0,0 +1,41 @@
name: Release Drafter
on:
push:
# branches to consider in the event; optional, defaults to all
branches:
- main
# pull_request event is required only for autolabeler
# pull_request:
# # Only following types are handled by the action, but one can default to all as well
# types: [opened, reopened, synchronize]
# # pull_request_target event is required for autolabeler to support PRs from forks
# pull_request_target:
# types: [opened, reopened, synchronize]
permissions:
contents: read
jobs:
update_release_draft:
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: read
runs-on: ubuntu-latest
steps:
# (Optional) GitHub Enterprise requires GHE_HOST variable set
#- name: Set GHE_HOST
# run: |
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v6
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
with:
config-name: release-drafter.yml
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}