Skip to content

Commit

Permalink
Add metafile.json to track version and checksum of artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
harrryr committed Dec 8, 2024
1 parent fac2f0e commit 32d4fec
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/post_release_version_bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
exit 1
fi

prepare-main:
runs-on: ubuntu-latest
needs: check-version
Expand Down Expand Up @@ -102,6 +101,25 @@ jobs:
sed -i 's/python:v.*"/python:v'$VERSION'"/' .github/workflows/daily_scan.yml
git add aws-opentelemetry-distro/src/amazon/opentelemetry/distro/version.py
git add .github/workflows/daily_scan.yml
- name: Append latest release checksum to release-build-metadata.json
run: |
ARTIFACT_NAME="aws_opentelemetry_distro-${{ github.event.inputs.version }}-py3-none-any.whl"
curl -L -o $ARTIFACT_NAME https://github.com/aws-observability/aws-otel-python-instrumentation/releases/download/v${{ github.event.inputs.version }}/$ARTIFACT_NAME
CHECKSUM=$(shasum -a 256 $ARTIFACT_NAME | awk '{ print $1 }')
FILE="release-build-metadata.json"
UPDATED_JSON=$(jq --arg version "${{ env.VERSION }}" \
--arg name "$ARTIFACT_NAME" \
--arg checksum "$CHECKSUM" \
'.release += [{"version": $version, "checksum": [{"name": $name, "checksum": $checksum}]}]' "$FILE")
echo "$UPDATED_JSON" > "$FILE"
git add release-build-metadata.json
- name: Push changes to Github
run: |
git commit -m "Prepare main for next development cycle: Update version to $DEV_VERSION"
git push --set-upstream origin "prepare-main-for-next-dev-cycle-${VERSION}"
Expand All @@ -111,10 +129,10 @@ jobs:
run: |
DEV_VERSION="${{ github.event.inputs.version }}.dev0"
gh pr create --title "Post release $VERSION: Update version to $DEV_VERSION" \
--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.
--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.
This PR should only be merge when release for version v$VERSION is success.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice." \
--head prepare-main-for-next-dev-cycle-${VERSION} \
--base main
--head prepare-main-for-next-dev-cycle-${VERSION} \
--base main
13 changes: 13 additions & 0 deletions release-build-metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"release": [
{
"version": "0.7.0",
"checksum": [
{
"name": "aws_opentelemetry_distro-0.7.0-py3-none-any.whl",
"checksum": "8cf682fa56bc00326a741acf480024550017beda41acb1b51af9d3b5ef1a9470"
}
]
}
]
}

0 comments on commit 32d4fec

Please sign in to comment.