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

NH-89068: fix nexus plugin #272

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -587,4 +587,4 @@ jobs:
echo "AGENT_VERSION=${{ steps.set_version.outputs.version }}.$GIT_HASH" >> $GITHUB_ENV

- name: Publish
run: ./gradlew publish
run: ./gradlew publishToSonatype
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
uses: gradle/actions/setup-gradle@v3

- name: Publish
run: ./gradlew publish
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The secrets are for publishing the build artifacts to the Maven Central.
Expand Down
18 changes: 16 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ plugins{
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
}

group = "com.solarwinds"
def swoVersion = property('swo.agent.version')
group = "io.github.appoptics"
version = Boolean.parseBoolean(System.getenv("SNAPSHOT_BUILD")) ? "$swoVersion-SNAPSHOT" : swoVersion

subprojects {
apply plugin: "java"
Expand All @@ -49,7 +51,7 @@ subprojects {
bytebuddy : "1.12.10",
guava : "30.1-jre",
joboe : "10.0.12",
agent : "2.8.0", // the custom distro agent version
agent : swoVersion, // the custom distro agent version
autoservice : "1.0.1",
caffeine : "2.9.3",
json : "20231013",
Expand Down Expand Up @@ -138,3 +140,15 @@ subprojects {
disableAutoTargetJvm()
}
}

nexusPublishing {
repositories {
sonatype {
password = System.getenv("SONATYPE_TOKEN")
username = System.getenv("SONATYPE_USERNAME")

nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
}
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ systemProp.org.gradle.internal.repository.initial.backoff=500
# Project properties provides a central place for shared property among subprojects
otel.agent.version=2.8.0
otel.sdk.version=1.42.1
swo.agent.version=2.8.0
32 changes: 3 additions & 29 deletions solarwinds-otel-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ apply from: "$rootDir/gradle/shadow.gradle"
project.archivesBaseName = 'solarwinds-otel-sdk'
def relocatePackages = ext.relocatePackages

def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"

dependencies {
compileOnly project(":bootstrap")
compileOnly("io.opentelemetry:opentelemetry-sdk:${versions.opentelemetry}")
Expand Down Expand Up @@ -87,26 +84,15 @@ publishing {

groupId = 'io.github.appoptics'
artifactId = "${archivesBaseName}"
def sdkVersion = System.getenv("AGENT_VERSION") ?: "2.6.0"
version = Boolean.parseBoolean(System.getenv("SNAPSHOT_BUILD")) ? "$sdkVersion-SNAPSHOT" : "${versions.agent}"

def snapshotVersion = System.getenv("AGENT_VERSION")
version = Boolean.parseBoolean(System.getenv("SNAPSHOT_BUILD")) ? "${snapshotVersion}-SNAPSHOT" : "${versions.agent}"

from components.java
artifact sourcesJar
artifact javadocJar
}
}
publishToMavenLocal
}

repositories {
maven {
name = "OSSRH"
url = Boolean.parseBoolean(System.getenv("SNAPSHOT_BUILD")) ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_TOKEN")
}
}
}
}

Expand All @@ -129,16 +115,4 @@ test {

compileJava {
options.release.set(8)
}

nexusPublishing {
repositories {
sonatype {
password = System.getenv("SONATYPE_TOKEN")
username = System.getenv("SONATYPE_USERNAME")

nexusUrl = uri(releasesRepoUrl)
snapshotRepositoryUrl = uri(snapshotsRepoUrl)
}
}
}