Skip to content

Commit bd4d094

Browse files
committed
Add metafile.json to track version and checksum of artifacts
1 parent fac2f0e commit bd4d094

File tree

2 files changed

+35
-4
lines changed

2 files changed

+35
-4
lines changed

.github/workflows/post_release_version_bump.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ jobs:
5353
exit 1
5454
fi
5555
56-
5756
prepare-main:
5857
runs-on: ubuntu-latest
5958
needs: check-version
@@ -102,6 +101,25 @@ jobs:
102101
sed -i 's/python:v.*"/python:v'$VERSION'"/' .github/workflows/daily_scan.yml
103102
git add aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py
104103
git add .github/workflows/daily_scan.yml
104+
105+
- name: Append latest release checksum to release-artifacts-metadata.json
106+
run: |
107+
ARTIFACT_NAME="aws_opentelemetry_distro-${{ github.event.inputs.version }}-py3-none-any.whl"
108+
curl -L -o $ARTIFACT_NAME https://github.com/aws-observability/aws-otel-python-instrumentation/releases/download/v${{ github.event.inputs.version }}/$ARTIFACT_NAME
109+
110+
CHECKSUM=$(shasum -a 256 $ARTIFACT_NAME | awk '{ print $1 }')
111+
112+
FILE="release-artifacts-metadata.json"
113+
UPDATED_JSON=$(jq --arg version "${{ github.event.inputs.version }}" \
114+
--arg name "$ARTIFACT_NAME" \
115+
--arg checksum "$CHECKSUM" \
116+
'.release += [{"version": $version, "checksum": [{"name": $name, "checksum": $checksum}]}]' "$FILE")
117+
118+
echo "$UPDATED_JSON" > "$FILE"
119+
git add release-artifacts-metadata.json
120+
121+
- name: Push changes to Github
122+
run: |
105123
git commit -m "Prepare main for next development cycle: Update version to $DEV_VERSION"
106124
git push --set-upstream origin "prepare-main-for-next-dev-cycle-${VERSION}"
107125
@@ -111,10 +129,10 @@ jobs:
111129
run: |
112130
DEV_VERSION="${{ github.event.inputs.version }}.dev0"
113131
gh pr create --title "Post release $VERSION: Update version to $DEV_VERSION" \
114-
--body "This PR prepares the main branch for the next development cycle by updating the version to $DEV_VERSION and updating the image version to be scanned to the latest released.
132+
--body "This PR prepares the main branch for the next development cycle by updating the version to $DEV_VERSION, adding checksum for the new artifacts, and updating the image version to be scanned to the latest released.
115133
116134
This PR should only be merge when release for version v$VERSION is success.
117135
118136
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice." \
119-
--head prepare-main-for-next-dev-cycle-${VERSION} \
120-
--base main
137+
--head prepare-main-for-next-dev-cycle-${VERSION} \
138+
--base main

release-artifacts-metadata.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"release": [
3+
{
4+
"version": "0.7.0",
5+
"checksum": [
6+
{
7+
"name": "aws_opentelemetry_distro-0.7.0-py3-none-any.whl",
8+
"checksum": "8cf682fa56bc00326a741acf480024550017beda41acb1b51af9d3b5ef1a9470"
9+
}
10+
]
11+
}
12+
]
13+
}

0 commit comments

Comments
 (0)