diff --git a/.github/workflows/post_release_version_bump.yml b/.github/workflows/post_release_version_bump.yml index 6d53768c5..d7dc4b29c 100644 --- a/.github/workflows/post_release_version_bump.yml +++ b/.github/workflows/post_release_version_bump.yml @@ -53,7 +53,6 @@ jobs: exit 1 fi - prepare-main: runs-on: ubuntu-latest needs: check-version @@ -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 "${{ github.event.inputs.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}" @@ -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 \ No newline at end of file diff --git a/release-artifacts-metadata.json b/release-artifacts-metadata.json new file mode 100644 index 000000000..19aed64a3 --- /dev/null +++ b/release-artifacts-metadata.json @@ -0,0 +1,13 @@ +{ + "release": [ + { + "version": "0.7.0", + "checksum": [ + { + "name": "aws_opentelemetry_distro-0.7.0-py3-none-any.whl", + "checksum": "8cf682fa56bc00326a741acf480024550017beda41acb1b51af9d3b5ef1a9470" + } + ] + } + ] +} \ No newline at end of file