From 5c53d70e4f1a2e8ba9f14b046ef9320a3822c534 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Tue, 19 Oct 2021 13:55:00 -0700 Subject: [PATCH 1/6] Sync gradle-plugins version with main project --- .github/scripts/local.init.gradle.kts | 9 +++++ .github/workflows/ci.yml | 15 +++++-- .github/workflows/gradle-plugins-release.yml | 31 --------------- .github/workflows/gradle-plugins-snapshot.yml | 39 ------------------- .github/workflows/nightly.yml | 6 ++- .github/workflows/patch-release-build.yml | 16 +++++++- .github/workflows/pr.yml | 4 +- .github/workflows/release-build.yml | 16 +++++++- RELEASING.md | 17 ++++++++ build.gradle.kts | 10 +---- conventions/build.gradle.kts | 4 +- .../otel.publish-conventions.gradle.kts | 4 -- examples/distro/build.gradle | 9 ++--- examples/distro/settings.gradle | 10 +++++ examples/extension/build.gradle | 12 +++--- examples/extension/settings.gradle | 1 + gradle-plugins/build.gradle.kts | 2 +- 17 files changed, 99 insertions(+), 106 deletions(-) delete mode 100644 .github/workflows/gradle-plugins-release.yml delete mode 100644 .github/workflows/gradle-plugins-snapshot.yml diff --git a/.github/scripts/local.init.gradle.kts b/.github/scripts/local.init.gradle.kts index 0b8ec23a0fcc..ff27a92de3e8 100644 --- a/.github/scripts/local.init.gradle.kts +++ b/.github/scripts/local.init.gradle.kts @@ -1,3 +1,12 @@ +settingsEvaluated { + settings.pluginManagement { + repositories { + mavenLocal() + removeIf { it.name == "sonatype" } + } + } +} + allprojects { repositories { mavenLocal() diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfe0386a801a..b86ce94011c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -271,11 +271,11 @@ jobs: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('examples/distro/gradle/wrapper/gradle-wrapper.properties') }} - - name: Local publish + - name: Local publish of artifacts # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/ run: ./gradlew publishToMavenLocal -x javadoc - - name: Local publish gradle plugin + - name: Local publish of gradle plugins run: ../gradlew publishToMavenLocal -x javadoc working-directory: gradle-plugins @@ -314,7 +314,7 @@ jobs: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - - name: Publish snapshot + - name: Build and publish artifact snapshots env: S3_BUILD_CACHE_ACCESS_KEY_ID: ${{ secrets.S3_BUILD_CACHE_ACCESS_KEY_ID }} S3_BUILD_CACHE_SECRET_KEY: ${{ secrets.S3_BUILD_CACHE_SECRET_KEY }} @@ -323,3 +323,12 @@ jobs: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} run: ./gradlew snapshot --stacktrace + + - name: Build and publish gradle plugin snapshots + env: + SONATYPE_USER: ${{ secrets.SONATYPE_USER }} + SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }} + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} + run: ../gradlew build publishToSonatype + working-directory: gradle-plugins diff --git a/.github/workflows/gradle-plugins-release.yml b/.github/workflows/gradle-plugins-release.yml deleted file mode 100644 index 98dc4a8bdc58..000000000000 --- a/.github/workflows/gradle-plugins-release.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Publish Gradle plugins to Gradle Plugin Portal - -on: - workflow_dispatch: - -jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.3.4 - with: - fetch-depth: 0 - - - name: Set up JDK 11 for running Gradle - uses: actions/setup-java@v2 - with: - distribution: adopt - java-version: 11 - - - name: Cache Gradle Wrapper - uses: actions/cache@v2 - with: - path: ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - - - name: Publish plugins - env: - GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} - GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} - run: ../gradlew build publishPlugins - working-directory: gradle-plugins diff --git a/.github/workflows/gradle-plugins-snapshot.yml b/.github/workflows/gradle-plugins-snapshot.yml deleted file mode 100644 index 7e122152f1c4..000000000000 --- a/.github/workflows/gradle-plugins-snapshot.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Publish Gradle plugin snapshots - -on: - push: - paths: - - 'gradle-plugins/**' - - '.github/workflows/gradle-plugins-snapshot.yml' - branches: - - main - workflow_dispatch: - -jobs: - snapshot: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.3.4 - with: - fetch-depth: 0 - - - name: Set up JDK 11 for running Gradle - uses: actions/setup-java@v2 - with: - distribution: adopt - java-version: 11 - - - name: Cache Gradle Wrapper - uses: actions/cache@v2 - with: - path: ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} - - - name: Publish snapshot - env: - SONATYPE_USER: ${{ secrets.SONATYPE_USER }} - SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }} - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} - run: ../gradlew build publishToSonatype - working-directory: gradle-plugins \ No newline at end of file diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ce8398cd8ea5..21b773ffeec4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -271,10 +271,14 @@ jobs: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('examples/distro/gradle/wrapper/gradle-wrapper.properties') }} - - name: Local publish + - name: Local publish of artifacts # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/ run: ./gradlew publishToMavenLocal -x javadoc + - name: Local publish of gradle plugins + run: ../gradlew publishToMavenLocal -x javadoc + working-directory: gradle-plugins + - name: Build distro run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts working-directory: examples/distro diff --git a/.github/workflows/patch-release-build.yml b/.github/workflows/patch-release-build.yml index 05c429157b7c..42b01e5ca66b 100644 --- a/.github/workflows/patch-release-build.yml +++ b/.github/workflows/patch-release-build.yml @@ -200,10 +200,14 @@ jobs: git fetch origin main git cherry-pick ${{ github.event.inputs.commits }} - - name: Local publish + - name: Local publish of artifacts # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/ run: ./gradlew publishToMavenLocal -x javadoc + - name: Local publish of gradle plugins + run: ../gradlew publishToMavenLocal -x javadoc + working-directory: gradle-plugins + - name: Build distro run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts working-directory: examples/distro @@ -243,7 +247,7 @@ jobs: with: job-id: jdk11 remote-build-cache-proxy-enabled: false - arguments: assemble final closeAndReleaseSonatypeStagingRepository --stacktrace -Prelease.version=${{ github.event.inputs.version }} + arguments: assemble final closeAndReleaseSonatypeStagingRepository --stacktrace env: SONATYPE_USER: ${{ secrets.SONATYPE_USER }} SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }} @@ -252,6 +256,14 @@ jobs: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} + # TODO (trask) cache gradle wrapper? + - name: Build and publish gradle plugins + env: + GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} + GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} + run: ../gradlew build publishPlugins + working-directory: gradle-plugins + - name: Push cherry-picked changes to the release branch run: git push diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 01671e2b7fbc..decace57d8ce 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -272,11 +272,11 @@ jobs: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('examples/distro/gradle/wrapper/gradle-wrapper.properties') }} - - name: Local publish + - name: Local publish of artifacts # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/ run: ./gradlew publishToMavenLocal -x javadoc - - name: Local publish gradle plugin + - name: Local publish of gradle plugins run: ../gradlew publishToMavenLocal -x javadoc working-directory: gradle-plugins diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 4731c7b1c1d8..08edef2dc313 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -122,10 +122,14 @@ jobs: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('examples/distro/gradle/wrapper/gradle-wrapper.properties') }} - - name: Local publish + - name: Local publish of artifacts # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/ run: ./gradlew publishToMavenLocal -x javadoc + - name: Local publish of gradle plugins + run: ../gradlew publishToMavenLocal -x javadoc + working-directory: gradle-plugins + - name: Build distro run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts working-directory: examples/distro @@ -154,7 +158,7 @@ jobs: with: job-id: jdk11 remote-build-cache-proxy-enabled: false - arguments: assemble final closeAndReleaseSonatypeStagingRepository --stacktrace -Prelease.version=${{ github.event.inputs.version }} + arguments: assemble final closeAndReleaseSonatypeStagingRepository --stacktrace env: SONATYPE_USER: ${{ secrets.SONATYPE_USER }} SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }} @@ -163,6 +167,14 @@ jobs: GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} + # TODO (trask) cache gradle wrapper? + - name: Build and publish gradle plugins + env: + GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }} + GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} + run: ../gradlew build publishPlugins + working-directory: gradle-plugins + - name: Create Release id: create_release uses: actions/create-release@v1.1.4 diff --git a/RELEASING.md b/RELEASING.md index 431c6e798cdc..1eaf2b6ace0e 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -15,6 +15,15 @@ next _minor_ release version. This means version `vX.(Y+1).0-SNAPSHOT`. ## Starting the Release +Before making the release: + +* Update `CHANGELOG.md` +* Update the version (remove `-SNAPSHOT`) in these files: + * build.gradle.kts + * gradle-plugins/build.gradle.kts + * examples/distro/build.gradle + * examples/extension/build.gradle + Open the release build workflow in your browser [here](https://github.com/open-telemetry/opentelemetry-java-instrumentation/actions/workflows/release-build.yml). You will see a button that says "Run workflow". Press the button, enter the version number you want @@ -23,6 +32,14 @@ to release in the input field that pops up, and then press "Run workflow". This triggers the release process, which builds the artifacts, publishes the artifacts, and creates and pushes a git tag with the version number. +After making the release: + +* Update the version (bump and add `-SNAPSHOT`) in these files: + * build.gradle.kts + * gradle-plugins/build.gradle.kts + * examples/distro/build.gradle + * examples/extension/build.gradle + ## Announcement Once the GitHub workflow completes, go to Github [release diff --git a/build.gradle.kts b/build.gradle.kts index 53901f62e893..95a817e472a4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,3 @@ -import nebula.plugin.release.git.opinion.Strategies import java.time.Duration plugins { @@ -6,16 +5,11 @@ plugins { id("com.github.ben-manes.versions") id("io.github.gradle-nexus.publish-plugin") - id("nebula.release") id("otel.spotless-conventions") } -release { - defaultVersionStrategy = Strategies.getSNAPSHOT() -} - -nebulaRelease { - addReleaseBranchPattern("""v\d+\.\d+\.x""") +allprojects { + version = "1.8.0-SNAPSHOT" } nexusPublishing { diff --git a/conventions/build.gradle.kts b/conventions/build.gradle.kts index c912447f065c..b823dd795485 100644 --- a/conventions/build.gradle.kts +++ b/conventions/build.gradle.kts @@ -29,8 +29,8 @@ dependencies { implementation(gradleApi()) implementation(localGroovy()) - implementation("io.opentelemetry.instrumentation.muzzle-generation:io.opentelemetry.instrumentation.muzzle-generation.gradle.plugin:0.8.0") - implementation("io.opentelemetry.instrumentation.muzzle-check:io.opentelemetry.instrumentation.muzzle-check.gradle.plugin:0.8.0") + implementation("io.opentelemetry.instrumentation.muzzle-generation:io.opentelemetry.instrumentation.muzzle-generation.gradle.plugin:${project.version}") + implementation("io.opentelemetry.instrumentation.muzzle-check:io.opentelemetry.instrumentation.muzzle-check.gradle.plugin:${project.version}") implementation("org.eclipse.aether:aether-connector-basic:1.1.0") implementation("org.eclipse.aether:aether-transport-http:1.1.0") diff --git a/conventions/src/main/kotlin/otel.publish-conventions.gradle.kts b/conventions/src/main/kotlin/otel.publish-conventions.gradle.kts index 5d08da336c3b..825110721a65 100644 --- a/conventions/src/main/kotlin/otel.publish-conventions.gradle.kts +++ b/conventions/src/main/kotlin/otel.publish-conventions.gradle.kts @@ -85,10 +85,6 @@ fun artifactPrefix(p: Project, archivesBaseName: String): String { return "opentelemetry-" } -rootProject.tasks.named("release").configure { - finalizedBy(tasks["publishToSonatype"]) -} - // Sign only if we have a key to do so val signingKey: String? = System.getenv("GPG_PRIVATE_KEY") // Stub out entire signing block off of CI since Gradle provides no way of lazy configuration of diff --git a/examples/distro/build.gradle b/examples/distro/build.gradle index c6c09a17d93e..6908679949ef 100644 --- a/examples/distro/build.gradle +++ b/examples/distro/build.gradle @@ -8,10 +8,10 @@ subprojects { ext { versions = [ - opentelemetry : "1.6.0", - opentelemetryAlpha : "1.6.0-alpha", - opentelemetryJavaagent : "1.7.0-SNAPSHOT", - opentelemetryJavaagentAlpha: "1.7.0-alpha-SNAPSHOT", + opentelemetry : "1.7.0", + opentelemetryAlpha : "1.7.0-alpha", + opentelemetryJavaagent : "1.8.0-SNAPSHOT", + opentelemetryJavaagentAlpha: "1.8.0-alpha-SNAPSHOT", bytebuddy : "1.10.18", guava : "30.1-jre" ] @@ -29,7 +29,6 @@ subprojects { repositories { mavenCentral() - mavenLocal() maven { name = "sonatype" url = uri("https://oss.sonatype.org/content/repositories/snapshots") diff --git a/examples/distro/settings.gradle b/examples/distro/settings.gradle index c0c40708a6ff..20d00c93547a 100644 --- a/examples/distro/settings.gradle +++ b/examples/distro/settings.gradle @@ -1,3 +1,13 @@ +pluginManagement { + repositories { + gradlePluginPortal() + maven { + name = "sonatype" + url = uri("https://oss.sonatype.org/content/repositories/snapshots") + } + } +} + rootProject.name = 'opentelemetry-java-instrumentation-distro-demo' include "agent" diff --git a/examples/extension/build.gradle b/examples/extension/build.gradle index 4625196d6644..3440617f725e 100644 --- a/examples/extension/build.gradle +++ b/examples/extension/build.gradle @@ -12,8 +12,8 @@ plugins { */ id "com.github.johnrengelman.shadow" version "6.1.0" - id "io.opentelemetry.instrumentation.muzzle-generation" version "0.8.0" - id "io.opentelemetry.instrumentation.muzzle-check" version "0.8.0" + id "io.opentelemetry.instrumentation.muzzle-generation" version "1.8.0-alpha-SNAPSHOT" + id "io.opentelemetry.instrumentation.muzzle-check" version "1.8.0-alpha-SNAPSHOT" } group 'io.opentelemetry.example' @@ -21,10 +21,10 @@ version '1.0' ext { versions = [ - opentelemetry : "1.6.0", - opentelemetryAlpha : "1.6.0-alpha", - opentelemetryJavaagent : "1.7.0-SNAPSHOT", - opentelemetryJavaagentAlpha: "1.7.0-alpha-SNAPSHOT", + opentelemetry : "1.7.0", + opentelemetryAlpha : "1.7.0-alpha", + opentelemetryJavaagent : "1.8.0-SNAPSHOT", + opentelemetryJavaagentAlpha: "1.8.0-alpha-SNAPSHOT", ] deps = [ diff --git a/examples/extension/settings.gradle b/examples/extension/settings.gradle index 763ae16c856b..e04091986845 100644 --- a/examples/extension/settings.gradle +++ b/examples/extension/settings.gradle @@ -3,6 +3,7 @@ pluginManagement { mavenLocal() gradlePluginPortal() maven { + name = "sonatype" url = uri("https://oss.sonatype.org/content/repositories/snapshots") } } diff --git a/gradle-plugins/build.gradle.kts b/gradle-plugins/build.gradle.kts index ce39ab78f81d..6a00552a3477 100644 --- a/gradle-plugins/build.gradle.kts +++ b/gradle-plugins/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } group = "io.opentelemetry.instrumentation" -version = "0.8.0" +version = "1.8.0-SNAPSHOT" repositories { mavenCentral() From 7db76b499af59c7972dc24453a15ca7680664e64 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Tue, 19 Oct 2021 17:41:39 -0700 Subject: [PATCH 2/6] More fixes --- conventions/build.gradle.kts | 8 ++++++-- .../src/main/kotlin/otel.publish-conventions.gradle.kts | 2 +- examples/extension/settings.gradle | 1 - gradle-plugins/build.gradle.kts | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/conventions/build.gradle.kts b/conventions/build.gradle.kts index b823dd795485..dd4fd0d152bf 100644 --- a/conventions/build.gradle.kts +++ b/conventions/build.gradle.kts @@ -25,12 +25,16 @@ tasks.withType().configureEach { useJUnitPlatform() } +val versionParts = version.toString().split("-").toMutableList() +versionParts[0] += "-alpha" +var alphaVersion = versionParts.joinToString("-") + dependencies { implementation(gradleApi()) implementation(localGroovy()) - implementation("io.opentelemetry.instrumentation.muzzle-generation:io.opentelemetry.instrumentation.muzzle-generation.gradle.plugin:${project.version}") - implementation("io.opentelemetry.instrumentation.muzzle-check:io.opentelemetry.instrumentation.muzzle-check.gradle.plugin:${project.version}") + implementation("io.opentelemetry.instrumentation.muzzle-generation:io.opentelemetry.instrumentation.muzzle-generation.gradle.plugin:$alphaVersion") + implementation("io.opentelemetry.instrumentation.muzzle-check:io.opentelemetry.instrumentation.muzzle-check.gradle.plugin:$alphaVersion") implementation("org.eclipse.aether:aether-connector-basic:1.1.0") implementation("org.eclipse.aether:aether-transport-http:1.1.0") diff --git a/conventions/src/main/kotlin/otel.publish-conventions.gradle.kts b/conventions/src/main/kotlin/otel.publish-conventions.gradle.kts index 825110721a65..dab865f48e93 100644 --- a/conventions/src/main/kotlin/otel.publish-conventions.gradle.kts +++ b/conventions/src/main/kotlin/otel.publish-conventions.gradle.kts @@ -20,7 +20,7 @@ publishing { } if (findProperty("otel.stable") != "true") { - val versionParts = version.split('-').toMutableList() + val versionParts = version.toString().split('-').toMutableList() versionParts[0] += "-alpha" version = versionParts.joinToString("-") } diff --git a/examples/extension/settings.gradle b/examples/extension/settings.gradle index e04091986845..531daf64fe34 100644 --- a/examples/extension/settings.gradle +++ b/examples/extension/settings.gradle @@ -1,6 +1,5 @@ pluginManagement { repositories { - mavenLocal() gradlePluginPortal() maven { name = "sonatype" diff --git a/gradle-plugins/build.gradle.kts b/gradle-plugins/build.gradle.kts index 6a00552a3477..d706281e9695 100644 --- a/gradle-plugins/build.gradle.kts +++ b/gradle-plugins/build.gradle.kts @@ -9,7 +9,7 @@ plugins { } group = "io.opentelemetry.instrumentation" -version = "1.8.0-SNAPSHOT" +version = "1.8.0-alpha-SNAPSHOT" repositories { mavenCentral() From 5f2d443dc4a4b9a76491ce55ae2f02299de5bf03 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Tue, 19 Oct 2021 17:45:50 -0700 Subject: [PATCH 3/6] Can rely on examples build against all branches now? --- .github/workflows/pr.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index decace57d8ce..f75830bf6957 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -253,8 +253,6 @@ jobs: examples: runs-on: ubuntu-latest - # When we make PR against pre-release branch examples may point to yet-unpublished version - if: github.base_ref == 'main' steps: - uses: actions/checkout@v2.3.4 with: From c968484f35a3e18b600af8b34be9a608355afcee Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 20 Oct 2021 12:55:54 -0700 Subject: [PATCH 4/6] Use common version.gradle.kts --- build.gradle.kts | 4 +--- conventions/build.gradle.kts | 8 ++------ .../src/main/kotlin/otel.publish-conventions.gradle.kts | 6 ------ gradle-plugins/build.gradle.kts | 3 ++- version.gradle.kts | 7 +++++++ 5 files changed, 12 insertions(+), 16 deletions(-) create mode 100644 version.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts index 95a817e472a4..5748016f206f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,9 +8,7 @@ plugins { id("otel.spotless-conventions") } -allprojects { - version = "1.8.0-SNAPSHOT" -} +apply(from = "version.gradle.kts") nexusPublishing { packageGroup.set("io.opentelemetry") diff --git a/conventions/build.gradle.kts b/conventions/build.gradle.kts index dd4fd0d152bf..45ab05f4e81a 100644 --- a/conventions/build.gradle.kts +++ b/conventions/build.gradle.kts @@ -25,16 +25,12 @@ tasks.withType().configureEach { useJUnitPlatform() } -val versionParts = version.toString().split("-").toMutableList() -versionParts[0] += "-alpha" -var alphaVersion = versionParts.joinToString("-") - dependencies { implementation(gradleApi()) implementation(localGroovy()) - implementation("io.opentelemetry.instrumentation.muzzle-generation:io.opentelemetry.instrumentation.muzzle-generation.gradle.plugin:$alphaVersion") - implementation("io.opentelemetry.instrumentation.muzzle-check:io.opentelemetry.instrumentation.muzzle-check.gradle.plugin:$alphaVersion") + implementation("io.opentelemetry.instrumentation.muzzle-generation:io.opentelemetry.instrumentation.muzzle-generation.gradle.plugin:${version}") + implementation("io.opentelemetry.instrumentation.muzzle-check:io.opentelemetry.instrumentation.muzzle-check.gradle.plugin:${version}") implementation("org.eclipse.aether:aether-connector-basic:1.1.0") implementation("org.eclipse.aether:aether-transport-http:1.1.0") diff --git a/conventions/src/main/kotlin/otel.publish-conventions.gradle.kts b/conventions/src/main/kotlin/otel.publish-conventions.gradle.kts index dab865f48e93..75a8be439eca 100644 --- a/conventions/src/main/kotlin/otel.publish-conventions.gradle.kts +++ b/conventions/src/main/kotlin/otel.publish-conventions.gradle.kts @@ -19,12 +19,6 @@ publishing { } } - if (findProperty("otel.stable") != "true") { - val versionParts = version.toString().split('-').toMutableList() - versionParts[0] += "-alpha" - version = versionParts.joinToString("-") - } - afterEvaluate { val mavenGroupId: String? by project if (mavenGroupId != null) { diff --git a/gradle-plugins/build.gradle.kts b/gradle-plugins/build.gradle.kts index d706281e9695..bf4b2eb8b507 100644 --- a/gradle-plugins/build.gradle.kts +++ b/gradle-plugins/build.gradle.kts @@ -9,7 +9,8 @@ plugins { } group = "io.opentelemetry.instrumentation" -version = "1.8.0-alpha-SNAPSHOT" + +apply(from = "../version.gradle.kts") repositories { mavenCentral() diff --git a/version.gradle.kts b/version.gradle.kts new file mode 100644 index 000000000000..91a0e0234081 --- /dev/null +++ b/version.gradle.kts @@ -0,0 +1,7 @@ +allprojects { + if (findProperty("otel.stable") != "true") { + version = "1.8.0-alpha-SNAPSHOT" + } else { + version = "1.8.0-SNAPSHOT" + } +} From 06c81a5894333a63e31b0f2435c0430b2efb711e Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Wed, 20 Oct 2021 13:09:00 -0700 Subject: [PATCH 5/6] Update doc --- RELEASING.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index 1eaf2b6ace0e..017f400198a3 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -19,8 +19,7 @@ Before making the release: * Update `CHANGELOG.md` * Update the version (remove `-SNAPSHOT`) in these files: - * build.gradle.kts - * gradle-plugins/build.gradle.kts + * version.gradle.kts * examples/distro/build.gradle * examples/extension/build.gradle @@ -35,8 +34,7 @@ and pushes a git tag with the version number. After making the release: * Update the version (bump and add `-SNAPSHOT`) in these files: - * build.gradle.kts - * gradle-plugins/build.gradle.kts + * version.gradle.kts * examples/distro/build.gradle * examples/extension/build.gradle From acb827a7335c6f1bbd7f9310465ce7f7bff7a867 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Thu, 21 Oct 2021 11:09:45 -0700 Subject: [PATCH 6/6] Simplify --- conventions/build.gradle.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conventions/build.gradle.kts b/conventions/build.gradle.kts index 45ab05f4e81a..89f4c5f9b409 100644 --- a/conventions/build.gradle.kts +++ b/conventions/build.gradle.kts @@ -29,8 +29,8 @@ dependencies { implementation(gradleApi()) implementation(localGroovy()) - implementation("io.opentelemetry.instrumentation.muzzle-generation:io.opentelemetry.instrumentation.muzzle-generation.gradle.plugin:${version}") - implementation("io.opentelemetry.instrumentation.muzzle-check:io.opentelemetry.instrumentation.muzzle-check.gradle.plugin:${version}") + implementation("io.opentelemetry.instrumentation.muzzle-generation:io.opentelemetry.instrumentation.muzzle-generation.gradle.plugin") + implementation("io.opentelemetry.instrumentation.muzzle-check:io.opentelemetry.instrumentation.muzzle-check.gradle.plugin") implementation("org.eclipse.aether:aether-connector-basic:1.1.0") implementation("org.eclipse.aether:aether-transport-http:1.1.0")