Skip to content

Commit 79049d8

Browse files
authored
Add SHA-256 for layer.zip file in SDK and Lambda Layer Release Workflows (#337)
*Issue #, if available:* We require SHA-256 file for every artifact that we vend. Otherwise, our canaries will not be able to download the artifact and we will receive availability drop alarms. *Description of changes:* Add logic to generate and upload a SHA-256 file for `layer.zip` file in our lambda layer and sdk release workflows. **Test plan:** Tested `gh` commands in workflow steps work on release notes copy in forked repo. https://github.com/yiyuan-he/aws-otel-java-instrumentation/releases/tag/v2.0.0 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 08a9c1a commit 79049d8

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/release-lambda.yml

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

.github/workflows/release_build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,16 @@ jobs:
133133
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
134134
run: |
135135
# Download layer.zip from existing latest tagged SDK release note
136-
LATEST_SDK_VERSION=$(gh release list --repo "aws-observability/aws-otel-java-instrumentation" --json tagName,isLatest -q 'map(select(.isLatest==true)) | .[0].tagName')
136+
LATEST_SDK_VERSION=$(gh release list --repo "aws-observability/aws-otel-python-instrumentation" --json tagName,isLatest -q 'map(select(.isLatest==true)) | .[0].tagName')
137137
mkdir -p layer_artifact
138-
gh release download "$LATEST_SDK_VERSION" --repo "aws-observability/aws-otel-java-instrumentation" --pattern "layer.zip" --dir layer_artifact
138+
gh release download "$LATEST_SDK_VERSION" --repo "aws-observability/aws-otel-python-instrumentation" --pattern "layer.zip" --dir layer_artifact
139+
shasum -a 256 layer_artifact/layer.zip > layer_artifact/layer.zip.sha256
139140
140141
gh release create --target "$GITHUB_REF_NAME" \
141142
--title "Release v${{ github.event.inputs.version }}" \
142143
--draft \
143144
"v${{ github.event.inputs.version }}" \
144145
dist/${{ env.ARTIFACT_NAME }} \
145146
${{ env.ARTIFACT_NAME }}.sha256 \
146-
layer_artifact/layer.zip
147+
layer_artifact/layer.zip \
148+
layer_artifact/layer.zip.sha256

0 commit comments

Comments
 (0)