From 8aacb86c88f01e327756afb150568b78784a9c54 Mon Sep 17 00:00:00 2001 From: Sam Snyder Date: Fri, 11 Jun 2021 16:31:29 -0700 Subject: [PATCH] Update build logic in preparation for release --- .github/workflows/publish.yml | 4 ++-- build.gradle.kts | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ef2edff2b..1860b5084 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -37,7 +37,7 @@ jobs: - name: publish-candidate if: contains(github.ref, '-rc.') timeout-minutes: 30 - run: ./gradlew ${GRADLE_SWITCHES} -Prelease.disableGitChecks=true -Prelease.useLastTag=true candidate publish closeAndReleaseSonatypeStagingRepository -x test + run: ./gradlew ${GRADLE_SWITCHES} -Preleasing -Prelease.disableGitChecks=true -Prelease.useLastTag=true candidate publish closeAndReleaseSonatypeStagingRepository env: ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }} ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_TOKEN }} @@ -47,7 +47,7 @@ jobs: - name: publish-release if: (!contains(github.ref, '-rc.')) timeout-minutes: 30 - run: ./gradlew ${GRADLE_SWITCHES} -Prelease.disableGitChecks=true -Prelease.useLastTag=true final publish closeAndReleaseSonatypeStagingRepository -x test + run: ./gradlew ${GRADLE_SWITCHES} -Preleasing -Prelease.disableGitChecks=true -Prelease.useLastTag=true final publish closeAndReleaseSonatypeStagingRepository env: ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }} ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_TOKEN }} diff --git a/build.gradle.kts b/build.gradle.kts index 2fb2b5f27..c746f38cb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -16,7 +16,7 @@ plugins { `maven-publish` signing - id("org.jetbrains.kotlin.jvm") version "1.5.0" + id("org.jetbrains.kotlin.jvm") version "latest.release" id("nebula.maven-resolved-dependencies") version "17.3.2" id("nebula.release") version "15.3.1" id("io.github.gradle-nexus.publish-plugin") version "1.0.0" @@ -32,7 +32,7 @@ plugins { id("nebula.source-jar") version "17.3.2" id("nebula.maven-apache-license") version "17.3.2" - id("org.openrewrite.rewrite") version "5.0.0" + id("org.openrewrite.rewrite") version "latest.release" } apply(plugin = "nebula.publish-verification") @@ -49,9 +49,11 @@ group = "org.openrewrite.recipe" description = "Eliminate legacy Spring patterns and migrate between major Spring Boot versions. Automatically." repositories { - mavenLocal() - maven { - url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + if(!project.hasProperty("releasing")) { + mavenLocal() + maven { + url = uri("https://oss.sonatype.org/content/repositories/snapshots/") + } } mavenCentral() } @@ -79,8 +81,11 @@ configurations.all { } } -val rewriteVersion = "latest.integration" -val testingFrameworksVersion = "latest.integration" +var rewriteVersion = if(project.hasProperty("releasing")) { + "latest.release" +} else { + "latest.integration" +} dependencies { compileOnly("org.projectlombok:lombok:latest.release") annotationProcessor("org.projectlombok:lombok:latest.release") @@ -98,7 +103,7 @@ dependencies { // see https://github.com/gradle/kotlin-dsl-samples/issues/1301 for why (okhttp is leaking parts of kotlin stdlib) compileOnly("org.jetbrains.kotlin:kotlin-stdlib-jdk8") - runtimeOnly("org.openrewrite.recipe:rewrite-testing-frameworks:${testingFrameworksVersion}") + runtimeOnly("org.openrewrite.recipe:rewrite-testing-frameworks:${rewriteVersion}") testImplementation("org.jetbrains.kotlin:kotlin-reflect") testImplementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")