Skip to content

Commit 2e4f118

Browse files
authored
Get Sha256 Checksum for Release Artifacts (#289)
*Issue #, if available:* We want to provide the checksum of release artifact to customers. *Description of changes:* When new artifact is released through `release_build.yml`, get the sha256 checksum of the artifact then attach it to the release note as a `.sha256` file Example: [Release Note](https://github.com/harrryr/aws-otel-python-instrumentation/releases/tag/v) *Testing* Workflow run: https://github.com/harrryr/aws-otel-python-instrumentation/actions/runs/12384286607 Verified that the .sha256 has the correct content and running `shasum -a 256 -c <artifact_name>.sha256` returns the output `<artifact_name>: OK` 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 93c1588 commit 2e4f118

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

.github/workflows/release_build.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
RELEASE_PRIVATE_REPOSITORY: 020628701572.dkr.ecr.us-west-2.amazonaws.com/adot-autoinstrumentation-python
1515
RELEASE_PRIVATE_REGISTRY: 020628701572.dkr.ecr.us-west-2.amazonaws.com
1616
PACKAGE_NAME: aws-opentelemetry-distro
17+
ARTIFACT_NAME: aws_opentelemetry_distro-${{ github.event.inputs.version }}-py3-none-any.whl
1718

1819
permissions:
1920
id-token: write
@@ -88,15 +89,15 @@ jobs:
8889
TWINE_USERNAME: '__token__'
8990
TWINE_PASSWORD: ${{ env.TEST_PYPI_TOKEN_API_TOKEN }}
9091
run: |
91-
twine upload --repository testpypi --skip-existing --verbose dist/aws_opentelemetry_distro-${{ github.event.inputs.version }}-py3-none-any.whl
92+
twine upload --repository testpypi --skip-existing --verbose dist/${{ env.ARTIFACT_NAME }}
9293
9394
# Publish to prod PyPI
9495
- name: Publish to PyPI
9596
env:
9697
TWINE_USERNAME: '__token__'
9798
TWINE_PASSWORD: ${{ env.PROD_PYPI_TOKEN_API_TOKEN }}
9899
run: |
99-
twine upload --skip-existing --verbose dist/aws_opentelemetry_distro-${{ github.event.inputs.version }}-py3-none-any.whl
100+
twine upload --skip-existing --verbose dist/${{ env.ARTIFACT_NAME }}
100101
101102
# Publish to public ECR
102103
- name: Build and push public ECR image
@@ -120,6 +121,11 @@ jobs:
120121
tags: |
121122
${{ env.RELEASE_PRIVATE_REPOSITORY }}:v${{ github.event.inputs.version }}
122123
124+
- name: Get SHA256 checksum of wheel file
125+
id: get_sha256
126+
run: |
127+
shasum -a 256 dist/${{ env.ARTIFACT_NAME }} | sed "s|dist/||" > ${{ env.ARTIFACT_NAME }}.sha256
128+
123129
# Publish to GitHub releases
124130
- name: Create GH release
125131
id: create_release
@@ -130,4 +136,5 @@ jobs:
130136
--title "Release v${{ github.event.inputs.version }}" \
131137
--draft \
132138
"v${{ github.event.inputs.version }}" \
133-
dist/aws_opentelemetry_distro-${{ github.event.inputs.version }}-py3-none-any.whl
139+
dist/${{ env.ARTIFACT_NAME }} \
140+
${{ env.ARTIFACT_NAME }}.sha256

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ This project ensures compatibility with the following supported Python versions:
3939

4040
### Note on Amazon CloudWatch Application Signals
4141
[Amazon CloudWatch Application Signals](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Application-Monitoring-Sections.html) components are designed to seamlessly work with all library instrumentations offered by [OpenTelemetry Python auto-instrumentation](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/README.md). While upstream OpenTelemetry Python instrumentations are in beta, Application Signals components are stable, production ready and have also been tested for popular libraries/frameworks such as [Django, Boto3, and others](https://github.com/aws-observability/aws-otel-python-instrumentation/tree/main/contract-tests/images/applications). We will prioritize backward compatibility for Application Signals components, striving to ensure that they remain functional even in the face of potential breaking changes introduced by OpenTelemetry upstream libraries. Please [raise an issue](https://github.com/aws-observability/aws-otel-python-instrumentation/blob/main/CONTRIBUTING.md#reporting-bugsfeature-requests) if you notice Application Signals doesn't work for a particular OpenTelemetry supported library.
42+
43+
## Checksum Verification
44+
Artifacts released will include a `.sha256` file for checksum verification starting from v0.7.0
45+
To verify, run the command `shasum -a 256 -c <artifact_name>.sha256`
46+
It should return the output `<artifact_name>: OK` if the validation is successful

0 commit comments

Comments
 (0)