Skip to content

Commit 8b94703

Browse files
committed
use JReleaser via CLI
1 parent 816ffe7 commit 8b94703

File tree

6 files changed

+63
-52
lines changed

6 files changed

+63
-52
lines changed

.github/workflows/gradle-build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
- master
77
pull_request:
88

9+
env:
10+
GRADLE_OPTS: "-Dorg.gradle.console=plain -Dorg.gradle.daemon=false -Dorg.gradle.stacktrace=always"
11+
912
jobs:
1013
gradle:
1114
strategy:
@@ -28,7 +31,7 @@ jobs:
2831
add-job-summary-as-pr-comment: on-failure
2932

3033
- name: Execute Gradle build
31-
run: ./gradlew --console=plain --no-daemon --stacktrace --continue build
34+
run: ./gradlew --continue build
3235

3336
- name: Upload Test Report
3437
uses: actions/upload-artifact@v3

.github/workflows/jreleaser-release.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
description: 'Next version after release (-SNAPSHOT will be added automatically)'
1111
required: true
1212

13+
env:
14+
GRADLE_OPTS: "-Dorg.gradle.console=plain -Dorg.gradle.daemon=false -Dorg.gradle.stacktrace=always"
15+
1316
jobs:
1417
release:
1518
runs-on: ubuntu-latest
@@ -31,8 +34,16 @@ jobs:
3134
- name: Setup Gradle
3235
uses: gradle/actions/setup-gradle@v4
3336

34-
- name: JReleaser full release
37+
- name: Gradle build and publish to local
38+
run: ./gradlew publish -Pversion=${{ github.event.inputs.version }}
39+
40+
- name: JReleaser full-release
41+
uses: jreleaser/release-action@v2
42+
with:
43+
setup-java: false
3544
env:
45+
JRELEASER_STRICT: "true"
46+
JRELEASER_OUTPUT_DIRECTORY: "build/"
3647
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }}
3748
JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }}
3849
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.JRELEASER_MAVENCENTRAL_USERNAME }}
@@ -41,9 +52,8 @@ jobs:
4152
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
4253
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
4354
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
44-
run: ./gradlew --console=plain --no-daemon --stacktrace jreleaserFullRelease -Pversion=${{ github.event.inputs.version }}
4555

46-
- name: JReleaser release output
56+
- name: JReleaser upload output
4757
if: always()
4858
uses: actions/upload-artifact@v4
4959
with:

.sdkmanrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
java=21.0.5-tem
2+
jreleaser=1.15.0

build.gradle.kts

Lines changed: 2 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
plugins {
22
id("base")
33
id("idea")
4-
id("org.jreleaser") version ("1.15.0")
5-
id("org.barfuin.gradle.taskinfo") version ("2.2.0") // ./gradlew tiTree jreleaserFullRelease
4+
id("org.barfuin.gradle.taskinfo") version ("2.2.0") // ./gradlew tiTree publish
65
id("be.vbgn.ci-detect") version ("0.5.0")
76
}
87

@@ -23,47 +22,8 @@ tasks.withType<Wrapper> {
2322
distributionType = Wrapper.DistributionType.ALL
2423
}
2524

26-
jreleaser {
27-
strict = true
28-
signing {
29-
active = org.jreleaser.model.Active.ALWAYS
30-
armored = true
31-
mode = if (ci.isCi) org.jreleaser.model.Signing.Mode.MEMORY else org.jreleaser.model.Signing.Mode.COMMAND
32-
files = true
33-
artifacts = true
34-
checksums = true
35-
}
36-
deploy {
37-
maven {
38-
pomchecker {
39-
version = "1.14.0"
40-
failOnWarning = true
41-
failOnError = true
42-
}
43-
mavenCentral {
44-
create("sonatype") {
45-
active = org.jreleaser.model.Active.ALWAYS
46-
url = "https://central.sonatype.com/api/v1/publisher"
47-
stagingRepository("build/staging-deploy")
48-
applyMavenCentralRules = true
49-
sign = true
50-
namespace.set("org.framefork")
51-
retryDelay = 30
52-
maxRetries = 100
53-
}
54-
}
55-
}
56-
}
57-
release {
58-
github {
59-
enabled = true
60-
tagName = "v{{projectVersion}}"
61-
releaseName = "{{tagName}}"
62-
}
63-
}
64-
}
65-
6625
tasks.register<Delete>("cleanAllPublications") {
26+
outputs.upToDateWhen { false }
6727
setDelete(rootProject.layout.buildDirectory.dir("staging-deploy"))
6828
}
6929

buildSrc/src/main/kotlin/framefork.java-public.gradle.kts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
plugins {
22
id("framefork.java")
33
`maven-publish`
4-
signing
54
}
65

76
java {
@@ -62,8 +61,3 @@ publishing {
6261
tasks.named("publish") {
6362
dependsOn(rootProject.tasks.named("cleanAllPublications"))
6463
}
65-
66-
val publishTask = tasks.named("publish")
67-
rootProject.tasks.matching({ it.name.startsWith("jreleaser") }).configureEach {
68-
dependsOn(publishTask)
69-
}

jreleaser.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
project:
2+
vendor: Framefork
3+
name: typed-ids
4+
java:
5+
groupId: "org.framefork"
6+
multiProject: true
7+
8+
checksum:
9+
individual: true
10+
11+
signing:
12+
active: ALWAYS
13+
mode: MEMORY
14+
armored: true
15+
checksums: false
16+
17+
deploy:
18+
maven:
19+
pomchecker:
20+
version: "1.14.0"
21+
failOnError: true
22+
failOnWarning: true
23+
mavenCentral:
24+
sonatype:
25+
active: RELEASE
26+
url: https://central.sonatype.com/api/v1/publisher
27+
applyMavenCentralRules: true
28+
sign: true
29+
retryDelay: 30
30+
maxRetries: 100
31+
namespace: "org.framefork"
32+
stagingRepositories:
33+
- build/staging-deploy
34+
35+
release:
36+
github:
37+
enabled: true
38+
overwrite: true
39+
tagName: "v{{projectVersion}}"
40+
releaseName: "{{tagName}}"
41+
commitAuthor:
42+
name: 'Framefork BOT'
43+

0 commit comments

Comments
 (0)