From a5bf4c7fbb9f745373cb090eaa826418218432d3 Mon Sep 17 00:00:00 2001 From: Harry Date: Fri, 1 Nov 2024 14:37:35 -0700 Subject: [PATCH] Add checksum for wheel artifact and also add version.txt --- .github/workflows/release-build.yml | 21 +++++++++++++++++++++ checksum.txt | 0 version.txt | 0 3 files changed, 21 insertions(+) create mode 100644 checksum.txt create mode 100644 version.txt diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 24589df..cfc2b24 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -104,5 +104,26 @@ jobs: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} NPM_CONFIG_PROVENANCE: true run: npx lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes + + - name: Get SHA256 checksum of wheel file + id: get_sha256 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + checksum=$(shasum -a 256 aws-distro-opentelemetry-node-autoinstrumentation/aws-aws-distro-opentelemetry-node-autoinstrumentation-${{ github.event.inputs.version }}.tgz | awk '{ print $1 }') + echo "CHECKSUM=$checksum" >> $GITHUB_OUTPUT + + - name: Append checksum and update version + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "aws-aws-distro-opentelemetry-node-autoinstrumentation-${{ github.event.inputs.version }}.tgz ${{ steps.get_sha256.outputs.CHECKSUM }}" >> checksum.txt + echo "${{ github.event.inputs.version }}" > version.txt + + git config --local user.email "github-actions[bot]@users.noreply.github.com" + git config --local user.name "GitHub Action Release Workflow" + git add checksum.txt version.txt + git commit -m "Update latest version and append checksum" + git push \ No newline at end of file diff --git a/checksum.txt b/checksum.txt new file mode 100644 index 0000000..e69de29 diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..e69de29