Skip to content

Commit a61e46e

Browse files
committed
Add .sha256 file to the release note as an asset
1 parent aaa4b32 commit a61e46e

File tree

4 files changed

+15
-75
lines changed

4 files changed

+15
-75
lines changed

.github/workflows/post_release_version_bump.yml

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -102,43 +102,8 @@ jobs:
102102
VERSION="${{ github.event.inputs.version }}"
103103
git add src/AWS.Distro.OpenTelemetry.AutoInstrumentation/Version.cs
104104
git add build/Build.InstallationScripts.cs
105-
106-
- name: Append latest release checksum to release-build-metadata.json
107-
run: |
108-
ARTIFACT_NAMES=(
109-
"aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-arm64.zip"
110-
"aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip"
111-
"aws-distro-opentelemetry-dotnet-instrumentation-linux-musl-arm64.zip"
112-
"aws-distro-opentelemetry-dotnet-instrumentation-linux-musl-x64.zip"
113-
"aws-distro-opentelemetry-dotnet-instrumentation-windows.zip"
114-
"aws-otel-dotnet-install.sh"
115-
"AWS.Otel.DotNet.Auto.psm1"
116-
)
117-
118-
119-
BASE_URL="https://github.com/aws-observability/aws-otel-dotnet-instrumentation/releases/download/v${{ github.event.inputs.version }}"
120-
NEW_RELEASE=$(jq -n --arg version "${{ github.event.inputs.version }}" \
121-
'{version: $version, checksum: []}')
122-
for ARTIFACT_NAME in "${ARTIFACT_NAMES[@]}"; do
123-
curl -L -o "$ARTIFACT_NAME" "${BASE_URL}/${ARTIFACT_NAME}"
124-
CHECKSUM=$(shasum -a 256 $ARTIFACT_NAME | awk '{ print $1 }')
125-
126-
NEW_RELEASE=$(echo "$NEW_RELEASE" | jq --arg name "$ARTIFACT_NAME" \
127-
--arg checksum "$CHECKSUM" \
128-
'.checksum += [{"name": $name, "checksum": $checksum}]')
129-
done
130-
131-
FILE="release-build-metadata.json"
132-
UPDATED_JSON=$(jq --argjson new_release "$NEW_RELEASE" \
133-
'.release += [$new_release]' "$FILE")
134-
echo "$UPDATED_JSON" > "$FILE"
135-
136-
git add release-build-metadata.json
137-
138-
- name: Push changes to Github
139-
run: |
140-
git commit -m "Prepare main for next development cycle: Update version to ${{ github.event.inputs.version }}"
141-
git push --set-upstream origin "prepare-main-for-next-dev-cycle-${{ github.event.inputs.version }}"
105+
git commit -m "Prepare main for next development cycle: Update version to $DEV_VERSION"
106+
git push --set-upstream origin "prepare-main-for-next-dev-cycle-${VERSION}"
142107
143108
- name: Create Pull Request to main
144109
env:

.github/workflows/release_build.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
"v${{ github.event.inputs.version }}" \
117117
--notes "Release Verions v${{ github.event.inputs.version }}"
118118
119-
- name: Upload artifacts to release
119+
- name: Upload artifacts and checksum to release
120120
env:
121121
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122122
run: |
@@ -125,15 +125,21 @@ jobs:
125125
find ./artifacts/ -name "*.zip" | while read file; do
126126
base=$(basename "$file")
127127
cp "$file" "$base"
128+
shasum -a 256 $base > $base.sha256
128129
gh release upload "v${{ github.event.inputs.version }}" \
129130
$base \
131+
$base.sha256 \
130132
--clobber
131133
done
134+
shasum -a 256 ./installationScripts/aws-otel-dotnet-install.sh | sed "s|./installationScripts/||" > aws-otel-dotnet-install.sh.sha256
135+
shasum -a 256 ./installationScripts/AWS.Otel.DotNet.Auto.psm1 | sed "s|./installationScripts/||" > AWS.Otel.DotNet.Auto.psm1.sha256
132136
gh release upload "v${{ github.event.inputs.version }}" \
133137
./installationScripts/aws-otel-dotnet-install.sh \
138+
aws-otel-dotnet-install.sh.sha256 \
134139
--clobber
135140
gh release upload "v${{ github.event.inputs.version }}" \
136141
./installationScripts/AWS.Otel.DotNet.Auto.psm1 \
142+
AWS.Otel.DotNet.Auto.psm1.sha256 \
137143
--clobber
138144
gh release upload "v${{ github.event.inputs.version }}" \
139145
./artifacts/nuget/nuget-packages.zip \

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,9 @@ See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more inform
5555
## License
5656

5757
This project is licensed under the Apache-2.0 License.
58+
59+
## Checksum Verification
60+
61+
Artifacts released will include a `.sha256` file for checksum verification starting from v1.32.6
62+
To verify, run the command `shasum -a 256 -c <artifact_name>.sha256`
63+
It should return the output `<artifact_name>: OK` if the validation is successful

release-build-metadata.json

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)