Skip to content

Commit b84331a

Browse files
committed
Improve releases with auto release notes
1 parent cfa4872 commit b84331a

6 files changed

Lines changed: 162 additions & 0 deletions

File tree

.github/labeler.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
dependencies:
2+
- changed-files:
3+
- any-glob-to-any-file:
4+
- 'build.gradle'
5+
- 'build-publishing.gradle'
6+
- 'settings.gradle'
7+
- 'gradle/**'
8+
- 'mise.toml'
9+
- 'gradlew'
10+
- 'gradlew.bat'
11+
12+
infrastructure:
13+
- changed-files:
14+
- any-glob-to-any-file:
15+
- '.github/**'
16+
17+
documentation:
18+
- changed-files:
19+
- any-glob-to-any-file:
20+
- 'README.adoc'
21+
- 'CONTRIBUTORS'
22+
- 'NOTICE'
23+
- 'LICENSE'
24+
- 'LICENSE_HEADER'
25+
- 'examples/**'

.github/release-drafter.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name-template: 'SSHJ $RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
4+
categories:
5+
- title: '🔒 Security'
6+
labels:
7+
- 'security'
8+
- title: '🐛 Bug Fixes'
9+
labels:
10+
- 'bug'
11+
- 'fix'
12+
- title: '✨ New Features'
13+
labels:
14+
- 'enhancement'
15+
- 'feature'
16+
- title: '📦 Dependency Updates'
17+
labels:
18+
- 'dependencies'
19+
- 'dependency-upgrade'
20+
- title: '🔨 Improvements'
21+
labels:
22+
- 'improvement'
23+
- 'refactoring'
24+
- 'cleanup'
25+
- title: '📝 Documentation'
26+
labels:
27+
- 'documentation'
28+
- title: '🏗️ Infrastructure'
29+
labels:
30+
- 'ci'
31+
- 'build'
32+
- 'infrastructure'
33+
34+
change-template: '* $TITLE (#$NUMBER) @$AUTHOR'
35+
change-title-escapes: '\<*_&'
36+
37+
version-resolver:
38+
major:
39+
labels:
40+
- 'major'
41+
minor:
42+
labels:
43+
- 'minor'
44+
- 'enhancement'
45+
- 'feature'
46+
patch:
47+
labels:
48+
- 'patch'
49+
- 'bug'
50+
- 'fix'
51+
- 'security'
52+
- 'dependencies'
53+
default: minor
54+
55+
template: |
56+
## Changes
57+
58+
$CHANGES
59+
60+
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION

.github/workflows/labeler.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Labeler
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize, reopened]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
label-by-files:
13+
name: Label by changed files
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/labeler@v5
17+
with:
18+
repo-token: ${{ secrets.GITHUB_TOKEN }}
19+
sync-labels: false
20+
21+
label-by-title:
22+
name: Label by PR title
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/github-script@v7
26+
with:
27+
script: |
28+
const title = context.payload.pull_request.title.toLowerCase();
29+
30+
const rules = [
31+
{ label: 'security', re: /\b(cve|security|vulnerability|exploit|terrapin)\b/ },
32+
{ label: 'bug', re: /\b(fix(es|ed|ing)?|bug|regression|broken|crash)\b/ },
33+
{ label: 'enhancement', re: /\b(add(s|ed|ing)?|support(s|ed|ing)?|implement(s|ed)?|feature)\b/ },
34+
{ label: 'dependencies', re: /\b(upgrad(e|es|ed|ing)|bump(s|ed)?|depend(ency|encies))\b/ },
35+
{ label: 'improvement', re: /\b(refactor(ed|ing)?|clean(up)?|improv(e|es|ed|ing)|remov(e|es|ed|ing)|replac(e|es|ed|ing))\b/ },
36+
];
37+
38+
const toAdd = rules.filter(r => r.re.test(title)).map(r => r.label);
39+
if (toAdd.length === 0) return;
40+
41+
await github.rest.issues.addLabels({
42+
owner: context.repo.owner,
43+
repo: context.repo.repo,
44+
issue_number: context.payload.pull_request.number,
45+
labels: toAdd,
46+
});
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [opened, reopened, synchronize]
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
update_release_draft:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: release-drafter/release-drafter@v6
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,10 @@ jobs:
4747
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNINGPASSWORD }}
4848
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
4949
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }}
50+
- name: Publish GitHub Release
51+
uses: release-drafter/release-drafter@v6
52+
with:
53+
publish: true
54+
tag: ${{ github.ref_name }}
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ Issue tracker: https://github.com/hierynomus/sshj/issues
115115
Fork away!
116116

117117
== Release history
118+
Starting from version 0.40.0, release notes are published as https://github.com/hierynomus/sshj/releases[GitHub Releases].
119+
120+
The history below covers releases up to and including 0.39.0.
121+
118122
SSHJ 0.39.0 (2024-02-20)::
119123
* Upgraded dependencies
120124
* Remove hard dependencies on BouncyCastle, making it optional.

0 commit comments

Comments
 (0)