From 88483c99638fa246bcb880a4e9a6e21451579754 Mon Sep 17 00:00:00 2001 From: cleverchuk Date: Tue, 20 Aug 2024 12:48:24 -0400 Subject: [PATCH] CUST-110209: do maven release on push and use the new SDK in smoke test. --- .github/workflows/push.yml | 24 +++++++++++++++ .github/workflows/release.yml | 30 ------------------- smoke-tests/netty-test/build.gradle.kts | 10 +++++++ .../java/com/solarwinds/netty/NettyApp.java | 2 ++ 4 files changed, 36 insertions(+), 30 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index d9392ff6..a77d3b0b 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -22,9 +22,16 @@ env: SWO_EMAIL: ${{ secrets.SWO_EMAIL }} SWO_PWORD: ${{ secrets.SWO_PWORD }} STAGE_BUCKET: ${{ secrets.STAGE_BUCKET }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }} + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + GPG_PRIVATE_KEY_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} jobs: s3-stage-upload: # this job uploads the jar to stage s3 + needs: + - maven_staging_release runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -420,3 +427,20 @@ jobs: - name: Docker logout if: always() run: docker logout + + maven_staging_release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Publish + run: ./gradlew publish \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d6dc60a..ce635fbe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,11 +3,6 @@ name: Release on: workflow_dispatch: inputs: - run_maven_release: - type: boolean - default: false - required: false - description: Choose whether to do maven release run_github_release: type: boolean default: false @@ -34,31 +29,6 @@ env: PROD_BUCKET: ${{ secrets.PROD_BUCKET }} jobs: - maven_release: - if: inputs.run_maven_release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 - - - name: Publish - run: ./gradlew publish - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # The secrets are for publishing the build artifacts to the Maven Central. - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }} - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - GPG_PRIVATE_KEY_PASSPHRASE: ${{ secrets.GPG_PRIVATE_KEY_PASSPHRASE }} - github_release: if: inputs.run_github_release runs-on: ubuntu-latest diff --git a/smoke-tests/netty-test/build.gradle.kts b/smoke-tests/netty-test/build.gradle.kts index 73924ce2..11f8bff8 100644 --- a/smoke-tests/netty-test/build.gradle.kts +++ b/smoke-tests/netty-test/build.gradle.kts @@ -1,3 +1,5 @@ +import java.net.URI + /* * © SolarWinds Worldwide, LLC. All rights reserved. * @@ -25,10 +27,18 @@ version = "unspecified" repositories { mavenCentral() + maven { + url = URI.create("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials { + username = System.getenv("SONATYPE_USERNAME") + password = System.getenv("SONATYPE_TOKEN") + } + } } dependencies { implementation("io.netty:netty-common:4.1.94.Final") + implementation("io.github.appoptics:solarwinds-otel-sdk:2.6.0") testImplementation(platform("org.junit:junit-bom:5.9.1")) testImplementation("org.junit.jupiter:junit-jupiter") } diff --git a/smoke-tests/netty-test/src/main/java/com/solarwinds/netty/NettyApp.java b/smoke-tests/netty-test/src/main/java/com/solarwinds/netty/NettyApp.java index cde783c6..4086bbe7 100644 --- a/smoke-tests/netty-test/src/main/java/com/solarwinds/netty/NettyApp.java +++ b/smoke-tests/netty-test/src/main/java/com/solarwinds/netty/NettyApp.java @@ -17,11 +17,13 @@ package com.solarwinds.netty; import io.netty.util.NetUtil; +import com.solarwinds.api.ext.SolarwindsAgent; import java.util.concurrent.TimeUnit; public class NettyApp { public static void main(String[] args){ + SolarwindsAgent.setTransactionName("hello world!"); System.out.printf("Number of interfaces: %d%n",NetUtil.NETWORK_INTERFACES.size()); try { TimeUnit.MINUTES.sleep(1);