Skip to content

Commit 45d73ec

Browse files
authored
Create GitHub releases using spotless-changelog (#2196)
2 parents 3063abb + 8d28afb commit 45d73ec

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

.github/workflows/deploy.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# GH_TOKEN
21
# NEXUS_USER
32
# NEXUS_PASS64 (base64 NOTE: `base64` and `openssl base64` failed, had to use Java
43
# byte[] data = "{{password}}".getBytes(StandardCharsets.UTF_8);
@@ -29,8 +28,10 @@ jobs:
2928
build:
3029
runs-on: ubuntu-latest
3130
name: deploy
31+
permissions:
32+
contents: write
3233
env:
33-
gh_token: ${{ secrets.GH_TOKEN }}
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3435
ORG_GRADLE_PROJECT_nexus_user: ${{ secrets.NEXUS_USER }}
3536
ORG_GRADLE_PROJECT_nexus_pass64: ${{ secrets.NEXUS_PASS64 }}
3637
ORG_GRADLE_PROJECT_gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}
@@ -64,3 +65,6 @@ jobs:
6465
if: "${{ github.event.inputs.to_publish == 'lib' }}"
6566
run: |
6667
./gradlew :changelogPush -Prelease=true --stacktrace --warning-mode all --no-configuration-cache
68+
- run: git checkout main
69+
- run: git merge release --ff-only
70+
- run: git push origin main

gradle/changelog.gradle

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
String kind
2+
String releaseTitle
23
if (project.name == 'plugin-gradle') {
34
kind = 'gradle'
5+
releaseTitle = 'Gradle Plugin'
46
} else if (project.name == 'plugin-maven') {
57
kind = 'maven'
8+
releaseTitle = 'Maven Plugin'
69
} else {
710
assert project == rootProject
811
kind = 'lib'
12+
releaseTitle = 'Lib'
913
}
1014

1115
// the root project and plugins have their own changelogs
@@ -18,13 +22,15 @@ spotlessChangelog {
1822
branch 'release'
1923
tagPrefix "${kind}/"
2024
commitMessage "Published ${kind}/{{version}}" // {{version}} will be replaced
25+
tagMessage "${kind} v{{version}}\n\n{{changes}}"
26+
runAfterPush "gh release create ${kind}/{{version}} --title '${releaseTitle} v{{version}}' --notes-from-tag"
2127

2228
if (kind == 'gradle') {
23-
forceNextVersion '7.0.0.BETA1'
29+
forceNextVersion '7.0.0.BETA2'
2430
} else if (kind == 'maven') {
25-
forceNextVersion '2.44.0.BETA1'
31+
forceNextVersion '2.44.0.BETA2'
2632
} else {
27-
forceNextVersion '3.0.0.BETA1'
33+
forceNextVersion '3.0.0.BETA2'
2834
}
2935
}
3036

settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ plugins {
1414
// https://github.com/spotbugs/spotbugs-gradle-plugin/releases
1515
id 'com.github.spotbugs' version '6.0.20' apply false
1616
// https://github.com/diffplug/spotless-changelog/blob/main/CHANGELOG.md
17-
id 'com.diffplug.spotless-changelog' version '3.0.2' apply false
17+
id 'com.diffplug.spotless-changelog' version '3.1.2' apply false
1818
// https://github.com/radarsh/gradle-test-logger-plugin/blob/develop/CHANGELOG.md
1919
id 'com.adarshr.test-logger' version '4.0.0' apply false
2020
// https://github.com/davidburstrom/version-compatibility-gradle-plugin/tags

0 commit comments

Comments
 (0)