diff --git a/.github/release_notes.template b/.github/release_notes.template index f079b6a681..747d2b2f34 100644 --- a/.github/release_notes.template +++ b/.github/release_notes.template @@ -4,7 +4,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_rust", - sha256 = "{sha256}", + integrity = "sha256-{sha256_base64}", urls = ["https://github.com/bazelbuild/rules_rust/releases/download/{version}/rules_rust-v{version}.tar.gz"], ) ``` diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index a4bdfffdbc..702cb3d254 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -132,8 +132,8 @@ jobs: # `examples/bzlmod` is included for the BCR presubmit; it must appear before --exclude="examples" tar -czf ${{ github.workspace }}/.github/rules_rust.tar.gz -C ${{ github.workspace }} --exclude=".git" --exclude=".github" --exclude="crate_universe/target" examples/bzlmod --exclude="examples" . # Save the sha256 checksum of the distro archive to the environment - sha256="$(shasum --algorithm 256 ${{ github.workspace }}/.github/rules_rust.tar.gz | awk '{ print $1 }')" - echo "ARCHIVE_SHA256=${sha256}" >> $GITHUB_ENV + sha256_base64="$(shasum --algorithm 256 ${{ github.workspace }}/.github/rules_rust.tar.gz | awk '{ print $1 }' | xxd -r -p | base64)" + echo "ARCHIVE_SHA256_BASE64=${sha256_base64}" >> $GITHUB_ENV env: CARGO_BAZEL_GENERATOR_URL: file://${{ github.workspace }}/crate_universe/target/artifacts/x86_64-unknown-linux-gnu/cargo-bazel ARTIFACTS_DIR: ${{ github.workspace }}/crate_universe/target/artifacts @@ -148,7 +148,7 @@ jobs: run: | # Generate the release notes sed 's/{version}/${{ env.RELEASE_VERSION }}/g' ${{ github.workspace }}/.github/release_notes.template \ - | sed 's/{sha256}/${{ env.ARCHIVE_SHA256 }}/g' \ + | sed 's/{sha256_base64}/${{ env.ARCHIVE_SHA256_BASE64 }}/g' \ > ${{ github.workspace }}/.github/release_notes.txt - name: Create release uses: softprops/action-gh-release@v1