Skip to content

Commit e4afed2

Browse files
Support multiple release drafter configs (#484)
1 parent 3fae490 commit e4afed2

3 files changed

Lines changed: 55 additions & 12 deletions

File tree

.github/release-drafter-v3.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name-template: '$RESOLVED_VERSION'
2+
tag-template: '$RESOLVED_VERSION'
3+
version-template: '3.$MINOR.$PATCH'
4+
filter-by-commitish: true
5+
commitish: v3
6+
categories:
7+
- title: '🚀 Features'
8+
labels:
9+
- 'feature'
10+
- 'enhancement'
11+
- title: '🐛 Bug Fixes'
12+
labels:
13+
- 'fix'
14+
- 'bugfix'
15+
- 'bug'
16+
- title: '🧰 Maintenance'
17+
labels:
18+
- 'chore'
19+
- 'maintenance'
20+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
21+
change-title-escapes: '\<*_&'
22+
version-resolver:
23+
minor:
24+
labels:
25+
- 'minor-release'
26+
patch:
27+
labels:
28+
- 'patch-release'
29+
default: patch
30+
template: |
31+
## Changes since $PREVIOUS_TAG
32+
33+
$CHANGES

.github/release-drafter.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name-template: "$RESOLVED_VERSION"
22
tag-template: "$RESOLVED_VERSION"
3+
version-template: '2.$MINOR.$PATCH'
4+
filter-by-commitish: true
5+
commitish: master
36
categories:
47
- title: "🚀 Features"
58
labels:
@@ -44,13 +47,13 @@ autolabeler:
4447
version-resolver:
4548
major:
4649
labels:
47-
- "major"
50+
- "major-release"
4851
minor:
4952
labels:
50-
- "minor"
53+
- "minor-release"
5154
patch:
5255
labels:
53-
- "patch"
56+
- "patch-release"
5457
default: patch
5558
template: |
5659
## Changes since $PREVIOUS_TAG

.github/workflows/release-drafter.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ on:
66
# branches to consider in the event; optional, defaults to all
77
branches:
88
- master
9+
- v3
910
# pull_request event is required only for autolabeler
1011
pull_request:
1112
branches:
1213
- master
14+
- v3
1315
# Only following types are handled by the action, but one can default to all as well
1416
types:
1517
- opened
@@ -19,6 +21,7 @@ on:
1921
pull_request_target:
2022
branches:
2123
- master
24+
- v3
2225
types:
2326
- opened
2427
- reopened
@@ -39,18 +42,22 @@ jobs:
3942
pull-requests: write
4043
runs-on: ubuntu-latest
4144
steps:
42-
# (Optional) GitHub Enterprise requires GHE_HOST variable set
43-
#- name: Set GHE_HOST
44-
# run: |
45-
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
45+
- name: Determine config file
46+
id: config
47+
run: |
48+
if [[ "${{ github.ref }}" == "refs/heads/v3" ]] || [[ "${{ github.base_ref }}" == "v3" ]]; then
49+
echo "config-name=release-drafter-v3.yml" >> $GITHUB_OUTPUT
50+
else
51+
echo "config-name=release-drafter.yml" >> $GITHUB_OUTPUT
52+
fi
4653
47-
# Drafts your next Release notes as Pull Requests are merged into "master"
48-
- uses: release-drafter/release-drafter@v6
54+
# Drafts your next Release notes as Pull Requests are merged into "master" or "v3"
55+
# TODO: Switch back to official action when this PR is merged: https://github.com/release-drafter/release-drafter/pull/1459
56+
# - uses: release-drafter/release-drafter@v6
57+
- uses: ChronosMasterOfAllTime/release-drafter@honor_version_template
4958
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
5059
with:
51-
commitish: master
52-
# config-name: my-config.yml
53-
# disable-autolabeler: true
60+
config-name: ${{ steps.config.outputs.config-name }}
5461
env:
5562
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5663
- name: Dispatch Pre-Release Job

0 commit comments

Comments
 (0)