diff --git a/.github/workflows/release-lambda.yml b/.github/workflows/release-lambda.yml index ec124a95f..7799dfe4d 100644 --- a/.github/workflows/release-lambda.yml +++ b/.github/workflows/release-lambda.yml @@ -212,3 +212,10 @@ jobs: layer_arns.tf layer.zip echo Removing release_notes.md ... rm -f release_notes.md + - name: Upload layer.zip to SDK Release Notes (tagged with latest) + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + LATEST_SDK_VERSION=$(gh release list --repo "aws-observability/aws-otel-python-instrumentation" --json tagName,isLatest -q 'map(select(.isLatest==true)) | .[0].tagName') + gh release upload "$LATEST_SDK_VERSION" layer.zip --repo "aws-observability/aws-otel-python-instrumentation" --clobber + echo "✅ layer.zip successfully uploaded to $LATEST_SDK_VERSION in the upstream repo!" diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index 7214547d6..c855e6dc5 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -132,9 +132,15 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token run: | + # Download layer.zip from existing latest tagged SDK release note + LATEST_SDK_VERSION=$(gh release list --repo "aws-observability/aws-otel-java-instrumentation" --json tagName,isLatest -q 'map(select(.isLatest==true)) | .[0].tagName') + mkdir -p layer_artifact + gh release download "$LATEST_SDK_VERSION" --repo "aws-observability/aws-otel-java-instrumentation" --pattern "layer.zip" --dir layer_artifact + gh release create --target "$GITHUB_REF_NAME" \ --title "Release v${{ github.event.inputs.version }}" \ --draft \ "v${{ github.event.inputs.version }}" \ dist/${{ env.ARTIFACT_NAME }} \ - ${{ env.ARTIFACT_NAME }}.sha256 \ No newline at end of file + ${{ env.ARTIFACT_NAME }}.sha256 \ + layer_artifact/layer.zip