From cfee98afe91bd5c5562da8bdedc579b0e5c37a6f Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Tue, 1 Feb 2022 18:14:58 -0800 Subject: [PATCH 01/21] update workflow --- build.gradle | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.gradle b/build.gradle index ba188d74..7ea11dbc 100644 --- a/build.gradle +++ b/build.gradle @@ -36,6 +36,13 @@ subprojects { maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") } + maven { + url = uri("https://maven.pkg.github.com/OWNER/REPOSITORY") + credentials { + username = project.findProperty("gpr.user") ?: System.getenv("USERNAME") + password = project.findProperty("gpr.key") ?: System.getenv("TOKEN") + } + } mavenLocal() mavenCentral() } From 66d11448fbf0cefa63a95d302ef2fe81807ed4b1 Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Tue, 1 Feb 2022 18:17:50 -0800 Subject: [PATCH 02/21] update workflow --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 7ea11dbc..517094a8 100644 --- a/build.gradle +++ b/build.gradle @@ -37,7 +37,7 @@ subprojects { url = uri("https://oss.sonatype.org/content/repositories/snapshots") } maven { - url = uri("https://maven.pkg.github.com/OWNER/REPOSITORY") + url = uri("https://maven.pkg.github.com/librato/joboe") credentials { username = project.findProperty("gpr.user") ?: System.getenv("USERNAME") password = project.findProperty("gpr.key") ?: System.getenv("TOKEN") From 93031e6d35f5c27eddbe4c4aa4907765b552e402 Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Wed, 2 Feb 2022 12:40:04 -0800 Subject: [PATCH 03/21] use secrets --- .github/workflows/gradle.yml | 5 +++-- .gitignore | 15 +-------------- build.gradle | 4 ++-- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index c11d2b74..1492f466 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -19,9 +19,7 @@ on: jobs: build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 - name: Set up JDK 11 @@ -33,3 +31,6 @@ jobs: uses: gradle/gradle-build-action@bc3340afc5e3cc44f2321809ac090d731c13c514 with: arguments: build + env: + GP_USERNAME: ${{ secrets.GP_USERNAME }} + GP_TOKEN: ${{ secrets.GP_TOKEN }} diff --git a/.gitignore b/.gitignore index 6267c5cd..b6ee7bee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,4 @@ -# explicitly list all the build directories instead of an asterisk (**/build/) to avoid possible unwanted match -/instrumentation/build/ -/agent/build/ -/appoptics-opentelemetry-sdk-shaded/build/ -/appoptics-opentelemetry-sdk/build/ -/buildSrc/build/ -/core-bootstrap/build/ -/custom/build/ -/instrumentation/appoptics-annotation/build/ -/instrumentation/jdbc/build/ -/instrumentation/spring/build/ -/instrumentation/spring/spring-webmvc-3.1/build/ -/sdk-extensions-bootstrap/build/ -/sdk-extensions/build/ **/build/ **/*.log .gradle/ +.DS_Store diff --git a/build.gradle b/build.gradle index 517094a8..f54c9e49 100644 --- a/build.gradle +++ b/build.gradle @@ -39,8 +39,8 @@ subprojects { maven { url = uri("https://maven.pkg.github.com/librato/joboe") credentials { - username = project.findProperty("gpr.user") ?: System.getenv("USERNAME") - password = project.findProperty("gpr.key") ?: System.getenv("TOKEN") + username = project.findProperty("gpr.user") ?: System.getenv("GP_USERNAME") + password = project.findProperty("gpr.key") ?: System.getenv("GP_TOKEN") } } mavenLocal() From caf5291844f892ed05fd4118e248ac62b31f2f2d Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Wed, 2 Feb 2022 15:54:26 -0800 Subject: [PATCH 04/21] update gradle publish config --- .github/workflows/gradle.yml | 5 +++-- agent/build.gradle | 22 ++++++++++++++++++++++ build.gradle | 4 ++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 1492f466..580ce73c 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -27,10 +27,11 @@ jobs: with: java-version: '11' distribution: 'temurin' - - name: Build with Gradle + - name: Build with Gradle and Publish uses: gradle/gradle-build-action@bc3340afc5e3cc44f2321809ac090d731c13c514 with: - arguments: build + arguments: publish env: GP_USERNAME: ${{ secrets.GP_USERNAME }} GP_TOKEN: ${{ secrets.GP_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/agent/build.gradle b/agent/build.gradle index 1f5a0350..00830bd6 100644 --- a/agent/build.gradle +++ b/agent/build.gradle @@ -1,5 +1,6 @@ plugins { id("com.github.johnrengelman.shadow") version "6.0.0" + id 'maven-publish' } apply from: "$rootDir/gradle/shadow.gradle" @@ -62,3 +63,24 @@ tasks { dependsOn(shadowJar) } } + +publishing { + publications { + maven(MavenPublication) { + groupId = 'com.solarwinds.agent' + artifactId = "${archivesBaseName}" + version = "${versions.agent}" + from components.java + } + } + repositories { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/appoptics/opentelemetry-java-instrumentation-custom-distro" + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } +} diff --git a/build.gradle b/build.gradle index f54c9e49..17cbe07e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ -group = "com.solarwinds" +group = "com.solarwinds.agent" subprojects { - version = rootProject.version +// version = rootProject.version apply plugin: "java" apply plugin: "muzzle" From bbd08cdfa4907ea6f04d300d396cf56fcb9b638b Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Thu, 3 Feb 2022 11:52:42 -0800 Subject: [PATCH 05/21] release and upload artifacts --- .github/workflows/gradle.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 580ce73c..ccfff00a 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -9,9 +9,8 @@ name: Java CI with Gradle on: push: - branches: [ main ] - pull_request: - branches: [ main ] + tags: + - "v*.*.*" workflow_dispatch: inputs: checkout-ref: @@ -35,3 +34,8 @@ jobs: GP_USERNAME: ${{ secrets.GP_USERNAME }} GP_TOKEN: ${{ secrets.GP_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Release and upload artifacts + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: "agent/build/libs/*.jar" From f1905ff419c20ee6247315dee7e24c2068d921ed Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Thu, 3 Feb 2022 12:01:04 -0800 Subject: [PATCH 06/21] update version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 17cbe07e..2ec7c169 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ subprojects { guava : "30.1-jre", appopticsCore : "7.0.2", appopticsMetrics : "7.0.0", - agent : "0.4.0" // the custom distro agent version + agent : "0.4.1-test" // the custom distro agent version ] versions.opentelemetryAlpha = "${versions.opentelemetry}-alpha" versions.opentelemetryJavaagentAlpha = "${versions.opentelemetryJavaagent}-alpha" From f3a7a0ad57dccfc4ec21bd63e75ff3fc37886625 Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Thu, 3 Feb 2022 12:02:07 -0800 Subject: [PATCH 07/21] update version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 2ec7c169..f8afaf0c 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ subprojects { guava : "30.1-jre", appopticsCore : "7.0.2", appopticsMetrics : "7.0.0", - agent : "0.4.1-test" // the custom distro agent version + agent : "0.4.2-test" // the custom distro agent version ] versions.opentelemetryAlpha = "${versions.opentelemetry}-alpha" versions.opentelemetryJavaagentAlpha = "${versions.opentelemetryJavaagent}-alpha" From 92fe0e01cc403ee82e81331b539c1d88bcc892e1 Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Thu, 3 Feb 2022 12:32:44 -0800 Subject: [PATCH 08/21] update version --- .github/workflows/gradle.yml | 6 ++++++ build.gradle | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index ccfff00a..9e1f2811 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -26,6 +26,11 @@ jobs: with: java-version: '11' distribution: 'temurin' + - name: "Build Changelog" + id: github_release + uses: mikepenz/release-changelog-builder-action@{latest-release} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build with Gradle and Publish uses: gradle/gradle-build-action@bc3340afc5e3cc44f2321809ac090d731c13c514 with: @@ -38,4 +43,5 @@ jobs: uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/') with: + body: "${{steps.github_release.outputs.changelog}}" files: "agent/build/libs/*.jar" diff --git a/build.gradle b/build.gradle index f8afaf0c..f85617e4 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ subprojects { guava : "30.1-jre", appopticsCore : "7.0.2", appopticsMetrics : "7.0.0", - agent : "0.4.2-test" // the custom distro agent version + agent : "0.4.3-test" // the custom distro agent version ] versions.opentelemetryAlpha = "${versions.opentelemetry}-alpha" versions.opentelemetryJavaagentAlpha = "${versions.opentelemetryJavaagent}-alpha" From d8765338efb4c5a611195746f2bdb5d2a6e84fe8 Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Thu, 3 Feb 2022 12:35:21 -0800 Subject: [PATCH 09/21] fix action version --- .github/workflows/gradle.yml | 2 +- build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 9e1f2811..669aa0b8 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -28,7 +28,7 @@ jobs: distribution: 'temurin' - name: "Build Changelog" id: github_release - uses: mikepenz/release-changelog-builder-action@{latest-release} + uses: mikepenz/release-changelog-builder-action@v2.8.2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build with Gradle and Publish diff --git a/build.gradle b/build.gradle index f85617e4..17cbe07e 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,7 @@ subprojects { guava : "30.1-jre", appopticsCore : "7.0.2", appopticsMetrics : "7.0.0", - agent : "0.4.3-test" // the custom distro agent version + agent : "0.4.0" // the custom distro agent version ] versions.opentelemetryAlpha = "${versions.opentelemetry}-alpha" versions.opentelemetryJavaagentAlpha = "${versions.opentelemetryJavaagent}-alpha" From 475a035d23038ac6b93dc52e6a976d2cbc865fcb Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Thu, 3 Feb 2022 13:28:03 -0800 Subject: [PATCH 10/21] add push workflow --- .github/workflows/push.yml | 30 +++++++++++++++++++ .github/workflows/{gradle.yml => release.yml} | 4 +-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/push.yml rename .github/workflows/{gradle.yml => release.yml} (93%) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 00000000..272750ad --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,30 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Push + +on: + push: + workflow_dispatch: + inputs: + checkout-ref: + description: "branch, tag or SHA to checkout. defaults to ref or SHA of triggering event." + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'temurin' + - name: Build with Gradle and Publish + uses: gradle/gradle-build-action@v2 + with: + arguments: test diff --git a/.github/workflows/gradle.yml b/.github/workflows/release.yml similarity index 93% rename from .github/workflows/gradle.yml rename to .github/workflows/release.yml index 669aa0b8..74c20443 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle -name: Java CI with Gradle +name: Release on: push: @@ -32,7 +32,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build with Gradle and Publish - uses: gradle/gradle-build-action@bc3340afc5e3cc44f2321809ac090d731c13c514 + uses: gradle/gradle-build-action@v2 with: arguments: publish env: From 7ec73689bcc596dc080fa389b0e3978dd520f8c0 Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Thu, 3 Feb 2022 14:43:32 -0800 Subject: [PATCH 11/21] add checkout ref --- .github/workflows/push.yml | 2 ++ .github/workflows/release.yml | 2 ++ build.gradle | 2 -- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 272750ad..766cd5af 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -19,6 +19,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + ref: ${{ github.event.inputs.checkout-ref }} - name: Set up JDK 11 uses: actions/setup-java@v2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 74c20443..a13ea8da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + ref: ${{ github.event.inputs.checkout-ref }} - name: Set up JDK 11 uses: actions/setup-java@v2 with: diff --git a/build.gradle b/build.gradle index 17cbe07e..d725cbeb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,6 @@ group = "com.solarwinds.agent" subprojects { -// version = rootProject.version - apply plugin: "java" apply plugin: "muzzle" apply plugin: "checkstyle" From 5103fd164afc84719aaed6e8dd0c15637ef4a65d Mon Sep 17 00:00:00 2001 From: Eric Yang Date: Wed, 16 Feb 2022 17:35:32 -0800 Subject: [PATCH 12/21] remove 3rd-party actions --- .github/workflows/release.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a13ea8da..e51c6739 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,9 +8,6 @@ name: Release on: - push: - tags: - - "v*.*.*" workflow_dispatch: inputs: checkout-ref: @@ -28,11 +25,6 @@ jobs: with: java-version: '11' distribution: 'temurin' - - name: "Build Changelog" - id: github_release - uses: mikepenz/release-changelog-builder-action@v2.8.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Build with Gradle and Publish uses: gradle/gradle-build-action@v2 with: @@ -42,8 +34,7 @@ jobs: GP_TOKEN: ${{ secrets.GP_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Release and upload artifacts - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - body: "${{steps.github_release.outputs.changelog}}" - files: "agent/build/libs/*.jar" + run: gh release create v${{ env.RELEASE_NAME }} --title "v${{ env.RELEASE_NAME }}" --target ${{ github.event.inputs.checkout-ref }} --draft core/target/core-*.jar agent/build/libs/*.jar + env: + RELEASE_NAME: ${{ github.event.inputs.release-name }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 64dcd780f057b745bc8e1dc40b265b657903b535 Mon Sep 17 00:00:00 2001 From: Eric Yang Date: Wed, 16 Feb 2022 17:39:42 -0800 Subject: [PATCH 13/21] Update build.gradle --- build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index d725cbeb..39612561 100644 --- a/build.gradle +++ b/build.gradle @@ -11,9 +11,9 @@ subprojects { opentelemetryJavaagent: "1.7.2", bytebuddy : "1.10.18", guava : "30.1-jre", - appopticsCore : "7.0.2", - appopticsMetrics : "7.0.0", - agent : "0.4.0" // the custom distro agent version + appopticsCore : "7.0.4", + appopticsMetrics : "7.0.4", + agent : "0.5.1" // the custom distro agent version ] versions.opentelemetryAlpha = "${versions.opentelemetry}-alpha" versions.opentelemetryJavaagentAlpha = "${versions.opentelemetryJavaagent}-alpha" From bacdad35eb8f61772a84843e32905bf3f910d8fa Mon Sep 17 00:00:00 2001 From: Eric Yang Date: Wed, 16 Feb 2022 17:43:13 -0800 Subject: [PATCH 14/21] Update push.yml --- .github/workflows/push.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 766cd5af..4f52b46d 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -30,3 +30,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: arguments: test + env: + GP_USERNAME: ${{ secrets.GP_USERNAME }} + GP_TOKEN: ${{ secrets.GP_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2ad25065288904a563d03402a8c36eb3e7bb8827 Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Thu, 17 Feb 2022 14:38:09 -0800 Subject: [PATCH 15/21] reuse workflow name --- .github/workflows/{release.yml => gradle.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{release.yml => gradle.yml} (98%) diff --git a/.github/workflows/release.yml b/.github/workflows/gradle.yml similarity index 98% rename from .github/workflows/release.yml rename to .github/workflows/gradle.yml index e51c6739..d014a6fa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/gradle.yml @@ -5,7 +5,7 @@ # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle -name: Release +name: Java CI with Gradle on: workflow_dispatch: From d31c998ac817b8b18ef02bdc217df1e821ae384d Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Thu, 17 Feb 2022 14:50:51 -0800 Subject: [PATCH 16/21] fix artifact name --- .github/workflows/gradle.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index d014a6fa..c84aa4c8 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -12,6 +12,8 @@ on: inputs: checkout-ref: description: branch, tag or SHA to checkout. defaults to ref or SHA of triggering event. + release-name: + description: the release name jobs: build: @@ -34,7 +36,7 @@ jobs: GP_TOKEN: ${{ secrets.GP_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Release and upload artifacts - run: gh release create v${{ env.RELEASE_NAME }} --title "v${{ env.RELEASE_NAME }}" --target ${{ github.event.inputs.checkout-ref }} --draft core/target/core-*.jar agent/build/libs/*.jar + run: gh release create v${{ env.RELEASE_NAME }} --title "v${{ env.RELEASE_NAME }}" --target ${{ github.event.inputs.checkout-ref }} --draft agent/build/libs/*.jar env: RELEASE_NAME: ${{ github.event.inputs.release-name }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e8e61a781110a4409aa8a4019cfef922ec24e039 Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Thu, 17 Feb 2022 14:52:03 -0800 Subject: [PATCH 17/21] remove version prefix --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index c84aa4c8..6aaac066 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -36,7 +36,7 @@ jobs: GP_TOKEN: ${{ secrets.GP_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Release and upload artifacts - run: gh release create v${{ env.RELEASE_NAME }} --title "v${{ env.RELEASE_NAME }}" --target ${{ github.event.inputs.checkout-ref }} --draft agent/build/libs/*.jar + run: gh release create ${{ env.RELEASE_NAME }} --title "${{ env.RELEASE_NAME }}" --target ${{ github.event.inputs.checkout-ref }} --draft agent/build/libs/*.jar env: RELEASE_NAME: ${{ github.event.inputs.release-name }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 26c79f74519e2d62f7abb0d833581eb5511ec63d Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Tue, 22 Feb 2022 14:15:48 -0800 Subject: [PATCH 18/21] remove unnecessary workflow_dispatch inputs --- .github/workflows/gradle.yml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 6aaac066..9f405c01 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,19 +1,11 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - +# This workflow builds the NightHawk agent, run the tests, then publish a new release. +# You'll need to bump the version by modifying `ext.versions.agent` property in the build.gradle file +# then manually run this workflow to cut off a new release. The release name will be in the form of \ +# "v+versionNumber". For example, if `ext.versions.agent` = 0.5.1, the release name will be "v0.5.1". name: Java CI with Gradle on: workflow_dispatch: - inputs: - checkout-ref: - description: branch, tag or SHA to checkout. defaults to ref or SHA of triggering event. - release-name: - description: the release name jobs: build: @@ -21,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: ${{ github.event.inputs.checkout-ref }} + ref: ${{ github.ref_name }} - name: Set up JDK 11 uses: actions/setup-java@v2 with: @@ -35,8 +27,10 @@ jobs: GP_USERNAME: ${{ secrets.GP_USERNAME }} GP_TOKEN: ${{ secrets.GP_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Set agent version env + run: | + echo "AGENT_VERSION=v$(cd agent/build/libs && unzip -p solarwinds-apm-agent-all.jar META-INF/MANIFEST.MF | grep Implementation-Version | awk '{ print $2 }')" >> $GITHUB_ENV - name: Release and upload artifacts - run: gh release create ${{ env.RELEASE_NAME }} --title "${{ env.RELEASE_NAME }}" --target ${{ github.event.inputs.checkout-ref }} --draft agent/build/libs/*.jar + run: gh release create ${{ env.AGENT_VERSION }} --title "${{ env.AGENT_VERSION }}" --target ${{ github.ref_name }} --draft agent/build/libs/*.jar env: - RELEASE_NAME: ${{ github.event.inputs.release-name }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8e18a1399ca829ba2c9a000a96709d274901c372 Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Tue, 22 Feb 2022 16:21:22 -0800 Subject: [PATCH 19/21] add comments, remove workflow_dispatch inputs --- .github/workflows/gradle.yml | 2 +- .github/workflows/push.yml | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 9f405c01..7833d355 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,6 +1,6 @@ # This workflow builds the NightHawk agent, run the tests, then publish a new release. # You'll need to bump the version by modifying `ext.versions.agent` property in the build.gradle file -# then manually run this workflow to cut off a new release. The release name will be in the form of \ +# then manually run this workflow to cut off a new release. The release name will be in the form of # "v+versionNumber". For example, if `ext.versions.agent` = 0.5.1, the release name will be "v0.5.1". name: Java CI with Gradle diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 4f52b46d..3195f7f5 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,18 +1,11 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle +# This workflow is triggered either by a push or by manually clicking `Run Workflow` in the Actions page. +# The purpose of the workflow is to build the agent and run the tests. name: Push on: push: workflow_dispatch: - inputs: - checkout-ref: - description: "branch, tag or SHA to checkout. defaults to ref or SHA of triggering event." jobs: build: @@ -20,17 +13,16 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: ${{ github.event.inputs.checkout-ref }} + ref: ${{ github.ref_name }} - name: Set up JDK 11 uses: actions/setup-java@v2 with: java-version: '11' distribution: 'temurin' - - name: Build with Gradle and Publish + - name: Build with Gradle and Test uses: gradle/gradle-build-action@v2 with: arguments: test env: GP_USERNAME: ${{ secrets.GP_USERNAME }} GP_TOKEN: ${{ secrets.GP_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 0bc08e398ca48f3dca22380cf037282f981ba0f6 Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Tue, 22 Feb 2022 16:37:16 -0800 Subject: [PATCH 20/21] comments for GITHUB_TOKEN and PAT --- .github/workflows/gradle.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 7833d355..11c3f39d 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -24,8 +24,13 @@ jobs: with: arguments: publish env: + # These two secrets `secrets.GP_USERNAME` and `secrets.GP_TOKEN` are Github's PAT (Personal Access Token), + # which are used to download private packages from Github Packages (in our case, the Joboe core libs from https://github.com/librato/joboe) + # Gradle fetches the dependencies from Github Packages with this user/token pair, see build.gradle for the repositories config. + # Check out this document about how to create a PAT: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token GP_USERNAME: ${{ secrets.GP_USERNAME }} GP_TOKEN: ${{ secrets.GP_TOKEN }} + # GITHUB_TOKEN is used to publish the build artifacts (the NightHawk agent) to Github Packages. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set agent version env run: | From 5636d5b2e91c826f1b432c5131c72658113977dd Mon Sep 17 00:00:00 2001 From: jiwen624 Date: Wed, 23 Feb 2022 09:53:10 -0800 Subject: [PATCH 21/21] update PAT comment --- .github/workflows/gradle.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 11c3f39d..41bf057c 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -27,7 +27,9 @@ jobs: # These two secrets `secrets.GP_USERNAME` and `secrets.GP_TOKEN` are Github's PAT (Personal Access Token), # which are used to download private packages from Github Packages (in our case, the Joboe core libs from https://github.com/librato/joboe) # Gradle fetches the dependencies from Github Packages with this user/token pair, see build.gradle for the repositories config. - # Check out this document about how to create a PAT: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token + # + # Currently the PAT is set up under the trace-build service account and just requires read:packages access to the Librato org. + # (Check out this document about how to create a PAT: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) GP_USERNAME: ${{ secrets.GP_USERNAME }} GP_TOKEN: ${{ secrets.GP_TOKEN }} # GITHUB_TOKEN is used to publish the build artifacts (the NightHawk agent) to Github Packages.