diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index ba18c58..5d07228 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -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: @@ -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 diff --git a/.github/workflows/jreleaser-release.yml b/.github/workflows/jreleaser-release.yml index 405772b..c63c736 100644 --- a/.github/workflows/jreleaser-release.yml +++ b/.github/workflows/jreleaser-release.yml @@ -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 @@ -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 }} @@ -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: diff --git a/.sdkmanrc b/.sdkmanrc index 7feabc2..e7c398b 100644 --- a/.sdkmanrc +++ b/.sdkmanrc @@ -1 +1,2 @@ java=21.0.5-tem +jreleaser=1.15.0 diff --git a/build.gradle.kts b/build.gradle.kts index ac375ae..0034bf2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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") } @@ -23,47 +22,8 @@ tasks.withType { 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("cleanAllPublications") { + outputs.upToDateWhen { false } setDelete(rootProject.layout.buildDirectory.dir("staging-deploy")) } diff --git a/buildSrc/src/main/kotlin/framefork.java-public.gradle.kts b/buildSrc/src/main/kotlin/framefork.java-public.gradle.kts index 735e8db..8962417 100644 --- a/buildSrc/src/main/kotlin/framefork.java-public.gradle.kts +++ b/buildSrc/src/main/kotlin/framefork.java-public.gradle.kts @@ -1,7 +1,6 @@ plugins { id("framefork.java") `maven-publish` - signing } java { @@ -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) -} diff --git a/jreleaser.yml b/jreleaser.yml new file mode 100644 index 0000000..e6c6796 --- /dev/null +++ b/jreleaser.yml @@ -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'