Skip to content

Commit

Permalink
Use the Java Wrapper Instrumentation version while publishing the layer
Browse files Browse the repository at this point in the history
Signed-off-by: Raphael Silva <rapphil@gmail.com>
  • Loading branch information
rapphil committed Aug 21, 2024
1 parent c712aab commit 18a9084
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/release-layer-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
JAVAAGENT_VERSION: ${{ steps.save-javaagent-version.outputs.JAVAAGENT_VERSION }}
JAVAWRAPPER_VERSION: ${{ steps.save-javawrapper-version.outputs.JAVAWRAPPER_VERSION }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -51,6 +52,14 @@ jobs:
JAVAAGENT_VERSION=$(java -jar ./opentelemetry-javaagent.jar)
echo "JAVAAGENT_VERSION=$JAVAAGENT_VERSION" >> $GITHUB_OUTPUT
- name: Save Java Wrapper Version
id: save-javawrapper-version
shell: bash
run: |
cd java
JAVAWRAPPER_VERSION=$(./gradlew layer-wrapper:printOtelJavaInstrumentationVersion -q)
echo "JAVAWRAPPER_VERSION=$JAVAWRAPPER_VERSION" >> $GITHUB_OUTPUT
publish-javaagent-layer:
uses: ./.github/workflows/layer-publish.yml
needs: build-layer
Expand Down Expand Up @@ -108,7 +117,7 @@ jobs:
with:
artifact-name: opentelemetry-javawrapper-layer.zip
layer-name: opentelemetry-javawrapper
component-version: "--"
component-version: ${{needs.build-layer.outputs.JAVAWRAPPER_VERSION}}
# architecture:
runtimes: java8.al2 java11 java17
release-group: prod
Expand Down
6 changes: 6 additions & 0 deletions java/layer-wrapper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ tasks {
dependsOn(createLayer)
}
}

tasks.register("printOtelJavaInstrumentationVersion") {
doLast {
println(project.configurations["runtimeClasspath"].resolvedConfiguration.resolvedArtifacts.find { it.name == "opentelemetry-aws-lambda-events-2.2" }?.moduleVersion?.id?.version)
}
}

0 comments on commit 18a9084

Please sign in to comment.