Skip to content

Commit

Permalink
Sync gradle-plugins version with main project (#4248)
Browse files Browse the repository at this point in the history
* Sync gradle-plugins version with main project

* More fixes

* Can rely on examples build against all branches now?

* Use common version.gradle.kts

* Update doc

* Simplify
  • Loading branch information
trask authored Oct 29, 2021
1 parent 81cb8e6 commit 37e24ec
Show file tree
Hide file tree
Showing 17 changed files with 78 additions and 101 deletions.
9 changes: 9 additions & 0 deletions .github/scripts/local.init.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
settingsEvaluated {
settings.pluginManagement {
repositories {
mavenLocal()
removeIf { it.name == "sonatype" }
}
}
}

allprojects {
repositories {
mavenLocal()
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,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 }}
Expand All @@ -324,3 +324,13 @@ jobs:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
run: ./gradlew snapshot

- 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
run: ./gradlew snapshot
31 changes: 0 additions & 31 deletions .github/workflows/gradle-plugins-release.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/gradle-plugins-snapshot.yml

This file was deleted.

10 changes: 9 additions & 1 deletion .github/workflows/patch-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ jobs:
with:
job-id: jdk11
remote-build-cache-proxy-enabled: false
arguments: assemble final closeAndReleaseSonatypeStagingRepository -Prelease.version=${{ github.event.inputs.version }}
arguments: assemble final closeAndReleaseSonatypeStagingRepository
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
Expand All @@ -257,6 +257,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

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ jobs:
with:
job-id: jdk11
remote-build-cache-proxy-enabled: false
arguments: assemble final closeAndReleaseSonatypeStagingRepository -Prelease.version=${{ github.event.inputs.version }}
arguments: assemble final closeAndReleaseSonatypeStagingRepository
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
Expand All @@ -168,6 +168,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
Expand Down
15 changes: 15 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ 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:
* version.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
Expand All @@ -23,6 +31,13 @@ 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:
* version.gradle.kts
* examples/distro/build.gradle
* examples/extension/build.gradle

## Announcement

Once the GitHub workflow completes, go to Github [release
Expand Down
10 changes: 1 addition & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
import nebula.plugin.release.git.opinion.Strategies
import java.time.Duration

plugins {
id("idea")

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""")
}
apply(from = "version.gradle.kts")

nexusPublishing {
packageGroup.set("io.opentelemetry")
Expand Down
4 changes: 2 additions & 2 deletions conventions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
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")
Expand Down
10 changes: 0 additions & 10 deletions conventions/src/main/kotlin/otel.publish-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@ publishing {
}
}

if (findProperty("otel.stable") != "true") {
val versionParts = version.split('-').toMutableList()
versionParts[0] += "-alpha"
version = versionParts.joinToString("-")
}

afterEvaluate {
val mavenGroupId: String? by project
if (mavenGroupId != null) {
Expand Down Expand Up @@ -85,10 +79,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
Expand Down
1 change: 0 additions & 1 deletion examples/distro/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ subprojects {

repositories {
mavenCentral()
mavenLocal()
maven {
name = "sonatype"
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
Expand Down
10 changes: 10 additions & 0 deletions examples/distro/settings.gradle
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions examples/extension/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion examples/extension/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pluginManagement {
repositories {
mavenLocal()
gradlePluginPortal()
maven {
name = "sonatype"
url = uri("https://oss.sonatype.org/content/repositories/snapshots")
}
}
Expand Down
3 changes: 2 additions & 1 deletion gradle-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ plugins {
}

group = "io.opentelemetry.instrumentation"
version = "0.8.0"

apply(from = "../version.gradle.kts")

repositories {
mavenCentral()
Expand Down
7 changes: 7 additions & 0 deletions version.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
allprojects {
if (findProperty("otel.stable") != "true") {
version = "1.8.0-alpha-SNAPSHOT"
} else {
version = "1.8.0-SNAPSHOT"
}
}

0 comments on commit 37e24ec

Please sign in to comment.