Skip to content

Commit 2536c30

Browse files
authored
chore: implement release-drafter (#285)
1 parent 7dcbe93 commit 2536c30

File tree

4 files changed

+147
-12
lines changed

4 files changed

+147
-12
lines changed

.github/release-drafter.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
categories:
4+
- title: "🚨 Breaking Changes"
5+
labels:
6+
- "breaking"
7+
- title: "🚀 Features"
8+
labels:
9+
- "enhancement"
10+
- title: "🐛 Bug Fixes"
11+
labels:
12+
- "bug"
13+
- title: "🧰 Maintenance"
14+
labels:
15+
- "maintenance"
16+
- "ci"
17+
- title: "📚 Documentation"
18+
labels:
19+
- "documentation"
20+
- title: "⬆️ Dependencies"
21+
labels:
22+
- "dependencies"
23+
24+
autolabeler:
25+
- label: "documentation"
26+
files:
27+
- "*.md"
28+
- "docs/**/*"
29+
branch:
30+
- '/docs{0,1}\/.+/'
31+
title:
32+
- "/^docs(\\(.+\\))?:/i"
33+
34+
- label: "bug"
35+
branch:
36+
- '/fix\/.+/'
37+
- '/bugfix\/.+/'
38+
title:
39+
- "/^fix(\\(.+\\))?:/i"
40+
41+
- label: "enhancement"
42+
branch:
43+
- '/feature\/.+/'
44+
- '/enhancement\/.+/'
45+
- '/improve\/.+/'
46+
title:
47+
- "/^feat(\\(.+\\))?:/i"
48+
49+
- label: "maintenance"
50+
title:
51+
- "/^chore(\\(.+\\))?:/i"
52+
53+
- label: "dependencies"
54+
files:
55+
- "package.json"
56+
- "package-lock.json"
57+
- "yarn.lock"
58+
- "npm-shrinkwrap.json"
59+
branch:
60+
- '/deps\/.+/'
61+
title:
62+
- "/^(build|deps)(\\(.+\\))?:/i"
63+
64+
- label: "breaking"
65+
title:
66+
- "/!:/i"
67+
body:
68+
- "/BREAKING CHANGE:/i"
69+
70+
version-resolver:
71+
major:
72+
labels:
73+
- "major"
74+
- "breaking"
75+
minor:
76+
labels:
77+
- "minor"
78+
- "enhancement"
79+
patch:
80+
labels:
81+
- "patch"
82+
- "bug"
83+
- "dependencies"
84+
- "documentation"
85+
default: patch
86+
87+
template: |
88+
## What's Changed
89+
$CHANGES
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Draft Release
2+
3+
# yamllint disable-line rule:truthy
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
pull_request_target:
10+
types: [opened, reopened, synchronize, edited]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
update_release_draft:
17+
name: Release-Drafter
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
issues: write
23+
steps:
24+
- name: 🚀 Prepare release
25+
uses: release-drafter/release-drafter@v6
26+
with:
27+
commitish: main # codespell:ignore commitish
28+
disable-autolabeler: false
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,18 @@ jobs:
4343
needs: check_if_should_run
4444
if: ${{ needs.check_if_should_run.outputs.should_run == 'true' }}
4545
runs-on: ubuntu-latest
46+
permissions:
47+
contents: write
48+
pull-requests: write
4649
steps:
4750
- uses: actions/checkout@v4
4851

49-
- name: Increment version
50-
id: version
51-
uses: reecetech/[email protected]
52+
- name: Publish release
53+
uses: release-drafter/release-drafter@v6
5254
with:
53-
scheme: semver
54-
increment: minor
55-
56-
- name: Create release
57-
uses: softprops/action-gh-release@v2
58-
with:
59-
tag_name: ${{ steps.version.outputs.v-version }}
60-
generate_release_notes: true
61-
make_latest: true
55+
publish: true
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6258

6359
post:
6460
name: Post Action
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: "Semantic Pull Request"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
permissions:
11+
pull-requests: read
12+
13+
jobs:
14+
main:
15+
name: Validate PR title
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: amannn/action-semantic-pull-request@v5
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)