Skip to content

Commit

Permalink
use JReleaser via CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
fprochazka committed Nov 15, 2024
1 parent 816ffe7 commit 8b94703
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 52 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- master
pull_request:

env:
GRADLE_OPTS: "-Dorg.gradle.console=plain -Dorg.gradle.daemon=false -Dorg.gradle.stacktrace=always"

jobs:
gradle:
strategy:
Expand All @@ -28,7 +31,7 @@ jobs:
add-job-summary-as-pr-comment: on-failure

- name: Execute Gradle build
run: ./gradlew --console=plain --no-daemon --stacktrace --continue build
run: ./gradlew --continue build

- name: Upload Test Report
uses: actions/upload-artifact@v3
Expand Down
16 changes: 13 additions & 3 deletions .github/workflows/jreleaser-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
description: 'Next version after release (-SNAPSHOT will be added automatically)'
required: true

env:
GRADLE_OPTS: "-Dorg.gradle.console=plain -Dorg.gradle.daemon=false -Dorg.gradle.stacktrace=always"

jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -31,8 +34,16 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: JReleaser full release
- name: Gradle build and publish to local
run: ./gradlew publish -Pversion=${{ github.event.inputs.version }}

- name: JReleaser full-release
uses: jreleaser/release-action@v2
with:
setup-java: false
env:
JRELEASER_STRICT: "true"
JRELEASER_OUTPUT_DIRECTORY: "build/"
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.JRELEASER_GITHUB_TOKEN }}
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.JRELEASER_MAVENCENTRAL_USERNAME }}
Expand All @@ -41,9 +52,8 @@ jobs:
JRELEASER_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
JRELEASER_GPG_SECRET_KEY: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
run: ./gradlew --console=plain --no-daemon --stacktrace jreleaserFullRelease -Pversion=${{ github.event.inputs.version }}

- name: JReleaser release output
- name: JReleaser upload output
if: always()
uses: actions/upload-artifact@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .sdkmanrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
java=21.0.5-tem
jreleaser=1.15.0
44 changes: 2 additions & 42 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
plugins {
id("base")
id("idea")
id("org.jreleaser") version ("1.15.0")
id("org.barfuin.gradle.taskinfo") version ("2.2.0") // ./gradlew tiTree jreleaserFullRelease
id("org.barfuin.gradle.taskinfo") version ("2.2.0") // ./gradlew tiTree publish
id("be.vbgn.ci-detect") version ("0.5.0")
}

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

jreleaser {
strict = true
signing {
active = org.jreleaser.model.Active.ALWAYS
armored = true
mode = if (ci.isCi) org.jreleaser.model.Signing.Mode.MEMORY else org.jreleaser.model.Signing.Mode.COMMAND
files = true
artifacts = true
checksums = true
}
deploy {
maven {
pomchecker {
version = "1.14.0"
failOnWarning = true
failOnError = true
}
mavenCentral {
create("sonatype") {
active = org.jreleaser.model.Active.ALWAYS
url = "https://central.sonatype.com/api/v1/publisher"
stagingRepository("build/staging-deploy")
applyMavenCentralRules = true
sign = true
namespace.set("org.framefork")
retryDelay = 30
maxRetries = 100
}
}
}
}
release {
github {
enabled = true
tagName = "v{{projectVersion}}"
releaseName = "{{tagName}}"
}
}
}

tasks.register<Delete>("cleanAllPublications") {
outputs.upToDateWhen { false }
setDelete(rootProject.layout.buildDirectory.dir("staging-deploy"))
}

Expand Down
6 changes: 0 additions & 6 deletions buildSrc/src/main/kotlin/framefork.java-public.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id("framefork.java")
`maven-publish`
signing
}

java {
Expand Down Expand Up @@ -62,8 +61,3 @@ publishing {
tasks.named("publish") {
dependsOn(rootProject.tasks.named("cleanAllPublications"))
}

val publishTask = tasks.named("publish")
rootProject.tasks.matching({ it.name.startsWith("jreleaser") }).configureEach {
dependsOn(publishTask)
}
43 changes: 43 additions & 0 deletions jreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
project:
vendor: Framefork
name: typed-ids
java:
groupId: "org.framefork"
multiProject: true

checksum:
individual: true

signing:
active: ALWAYS
mode: MEMORY
armored: true
checksums: false

deploy:
maven:
pomchecker:
version: "1.14.0"
failOnError: true
failOnWarning: true
mavenCentral:
sonatype:
active: RELEASE
url: https://central.sonatype.com/api/v1/publisher
applyMavenCentralRules: true
sign: true
retryDelay: 30
maxRetries: 100
namespace: "org.framefork"
stagingRepositories:
- build/staging-deploy

release:
github:
enabled: true
overwrite: true
tagName: "v{{projectVersion}}"
releaseName: "{{tagName}}"
commitAuthor:
name: 'Framefork BOT'
email: 'bot@framefork.org'

0 comments on commit 8b94703

Please sign in to comment.