Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync gradle-plugins version with main project #4248

Merged
merged 10 commits into from
Oct 29, 2021
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
11 changes: 10 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,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
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 --stacktrace -Prelease.version=${{ github.event.inputs.version }}
arguments: assemble final closeAndReleaseSonatypeStagingRepository --stacktrace
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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this not needed any more?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking now that we will remove -SNAPSHOT from artifact version at the same time, the locally published artifacts won't have -SNAPSHOT, and so this will work... I could definitely be wrong...

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 --stacktrace -Prelease.version=${{ github.event.inputs.version }}
arguments: assemble final closeAndReleaseSonatypeStagingRepository --stacktrace
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:${version}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

conventions always include plugins as composite, probably can skip version altogether.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice 👍

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")
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"
}
}