Add publishing integrity check after releasing (#4045)

Co-authored-by: Francisco <fg@frang.io>
This commit is contained in:
Ernesto García
2023-02-15 15:21:29 -06:00
committed by GitHub
parent 6d18435098
commit 4e8aa43a90
4 changed files with 47 additions and 1 deletions

View File

@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail
CHECKSUMS="$RUNNER_TEMP/checksums.txt"
# Extract tarball content into a tmp directory
tar xf "$TARBALL" -C "$RUNNER_TEMP"
# Move to extracted directory
cd "$RUNNER_TEMP/package"
# Checksum all Solidity files
find . -type f -name "*.sol" | xargs shasum > "$CHECKSUMS"
# Back to directory with git contents
cd "$GITHUB_WORKSPACE/contracts"
# Check against tarball contents
shasum -c "$CHECKSUMS"

View File

@ -20,6 +20,7 @@ dist_tag() {
cd contracts
TARBALL="$(npm pack | tee /dev/stderr | tail -1)"
echo "tarball_name=$TARBALL" >> $GITHUB_OUTPUT
echo "tarball=$(pwd)/$TARBALL" >> $GITHUB_OUTPUT
echo "tag=$(dist_tag)" >> $GITHUB_OUTPUT
cd ..

View File

@ -15,6 +15,6 @@ delete_tag() {
if [ "$TAG" = tmp ]; then
delete_tag "$TAG"
elif ["$TAG" = latest ]; then
elif [ "$TAG" = latest ]; then
delete_tag next
fi