Skip to content

Commit 61944cf

Browse files
committed
Add metafile.json to track version and checksum of artifacts
1 parent 302c093 commit 61944cf

File tree

2 files changed

+74
-2
lines changed

2 files changed

+74
-2
lines changed

.github/workflows/post_release_version_bump.yml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,43 @@ 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-
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}"
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 }}"
107142
108143
- name: Create Pull Request to main
109144
env:

release-build-metadata.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"release": [
3+
{
4+
"version": "1.4.0",
5+
"checksum": [
6+
{
7+
"name": "aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-arm64.zip",
8+
"checksum": "eb8528483cd2174ecdba997c5e8ad9cca29e7b925d4d940a5bd998182343827d"
9+
},
10+
{
11+
"name": "aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip",
12+
"checksum": "f793e834e6eb9f4e2f40b3c7879aeb01270e83e75144a397e0ae26bdd5c0d8b5"
13+
},
14+
{
15+
"name": "aws-distro-opentelemetry-dotnet-instrumentation-linux-musl-arm64.zip",
16+
"checksum": "064c42e3592a00db9dc952ee3d70da0c3d3fea02ca7a559030958ee84e1c46dd"
17+
},
18+
{
19+
"name": "aws-distro-opentelemetry-dotnet-instrumentation-linux-musl-x64.zip",
20+
"checksum": "fe0af95949f5839135c93c549816a535c50204d6e9625e7fc9dcabd4b627a529"
21+
},
22+
{
23+
"name": "aws-distro-opentelemetry-dotnet-instrumentation-windows.zip",
24+
"checksum": "ff5207bc59115b7dd62b9b462b334453414271f804998206954c94ff707c9827"
25+
},
26+
{
27+
"name": "aws-otel-dotnet-install.sh",
28+
"checksum": "b49dded80b2c25ccf99745b557af1143672b50621c2259b3a117503f2bdcbcef"
29+
},
30+
{
31+
"name": "AWS.Otel.DotNet.Auto.psm1",
32+
"checksum": "521c065a66424fc76e41a4d1ff62a2f2cfe850b4632f0726fb9ddf0419598b49"
33+
}
34+
]
35+
}
36+
]
37+
}

0 commit comments

Comments
 (0)