Skip to content

Commit a041769

Browse files
authored
Update SDK and Lambda Layer Release Workflows to Add layer.zip Artifacts (#165)
*Description of changes:* Same as: aws-observability/aws-otel-python-instrumentation#335 and aws-observability/aws-otel-python-instrumentation#337 By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent 746c648 commit a041769

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/release-build.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,20 @@ jobs:
9898
env:
9999
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
100100
run: |
101+
# Download layer.zip from existing latest tagged SDK release note
102+
LATEST_SDK_VERSION=$(gh release list --repo "aws-observability/aws-otel-js-instrumentation" --json tagName,isLatest -q 'map(select(.isLatest==true)) | .[0].tagName')
103+
mkdir -p layer_artifact
104+
gh release download "$LATEST_SDK_VERSION" --repo "aws-observability/aws-otel-js-instrumentation" --pattern "layer.zip" --dir layer_artifact
105+
shasum -a 256 layer_artifact/layer.zip > layer_artifact/layer.zip.sha256
106+
101107
gh release create --target "$GITHUB_REF_NAME" \
102108
--title "Release v${{ github.event.inputs.version }}" \
103109
--draft \
104110
"v${{ github.event.inputs.version }}" \
105111
aws-distro-opentelemetry-node-autoinstrumentation/${{ env.ARTIFACT_NAME }} \
106-
${{ env.ARTIFACT_NAME }}.sha256
112+
${{ env.ARTIFACT_NAME }}.sha256 \
113+
layer_artifact/layer.zip \
114+
layer_artifact/layer.zip.sha256
107115
108116
# Publish '@aws/aws-distro-opentelemetry-node-autoinstrumentation' to npm
109117
- name: Publish autoinstrumentation to npm
@@ -113,4 +121,3 @@ jobs:
113121
NPM_CONFIG_PROVENANCE: true
114122
run: npm publish
115123

116-

.github/workflows/release-lambda.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,3 +217,13 @@ jobs:
217217
layer_arns.tf layer.zip
218218
echo Removing release_notes.md ...
219219
rm -f release_notes.md
220+
- name: Upload layer.zip and SHA-256 checksum to SDK Release Notes (tagged with latest)
221+
env:
222+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
223+
run: |
224+
LATEST_SDK_VERSION=$(gh release list --repo "aws-observability/aws-otel-js-instrumentation" --json tagName,isLatest -q 'map(select(.isLatest==true)) | .[0].tagName')
225+
# Generate SHA-256 checksum for layer.zip
226+
shasum -a 256 layer.zip > layer.zip.sha256
227+
# Upload layer.zip and its checksum to the latest SDK release note
228+
gh release upload "$LATEST_SDK_VERSION" layer.zip layer.zip.sha256 --repo "aws-observability/aws-otel-js-instrumentation" --clobber
229+
echo "✅ layer.zip successfully uploaded to $LATEST_SDK_VERSION in the upstream repo!"

0 commit comments

Comments
 (0)