diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index cf574ce7..765ce169 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -98,12 +98,20 @@ 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-js-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-js-instrumentation" --pattern "layer.zip" --dir layer_artifact + shasum -a 256 layer_artifact/layer.zip > layer_artifact/layer.zip.sha256 + gh release create --target "$GITHUB_REF_NAME" \ --title "Release v${{ github.event.inputs.version }}" \ --draft \ "v${{ github.event.inputs.version }}" \ aws-distro-opentelemetry-node-autoinstrumentation/${{ env.ARTIFACT_NAME }} \ - ${{ env.ARTIFACT_NAME }}.sha256 + ${{ env.ARTIFACT_NAME }}.sha256 \ + layer_artifact/layer.zip \ + layer_artifact/layer.zip.sha256 # Publish '@aws/aws-distro-opentelemetry-node-autoinstrumentation' to npm - name: Publish autoinstrumentation to npm @@ -113,4 +121,3 @@ jobs: NPM_CONFIG_PROVENANCE: true run: npm publish - \ No newline at end of file diff --git a/.github/workflows/release-lambda.yml b/.github/workflows/release-lambda.yml index 886c6d60..0013068f 100644 --- a/.github/workflows/release-lambda.yml +++ b/.github/workflows/release-lambda.yml @@ -217,3 +217,13 @@ jobs: layer_arns.tf layer.zip echo Removing release_notes.md ... rm -f release_notes.md + - name: Upload layer.zip and SHA-256 checksum 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-js-instrumentation" --json tagName,isLatest -q 'map(select(.isLatest==true)) | .[0].tagName') + # Generate SHA-256 checksum for layer.zip + shasum -a 256 layer.zip > layer.zip.sha256 + # Upload layer.zip and its checksum to the latest SDK release note + gh release upload "$LATEST_SDK_VERSION" layer.zip layer.zip.sha256 --repo "aws-observability/aws-otel-js-instrumentation" --clobber + echo "✅ layer.zip successfully uploaded to $LATEST_SDK_VERSION in the upstream repo!"