Skip to content

Commit f35df29

Browse files
committed
ci: fix
1 parent cd78f68 commit f35df29

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/rust.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ jobs:
285285
cargo generate --path . standalone-contract --name test-contract
286286
cd test-contract
287287
gmake build test check clippy
288+
cargo clean
288289
cd ..
289290
cargo generate --path . workspace --name test-workspace
290291
cd test-workspace

workspace/scripts/reproducible_build_docker

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,15 @@ else
5555
TASKS+=" build "
5656
fi
5757

58-
$DOCKER run --platform=linux/amd64 --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS
58+
DOCKER_IMAGE_PLATFORM=linux/amd64
59+
if [[ "$(grep -E '^ID=' /etc/os-release 2>/dev/null | cut -d= -f2 | tr -d '"')" == "ubuntu" ]] && [[ "$(uname -m)" == "aarch64" ]]; then
60+
echo "Ubuntu ARM64 detected. Using docker image with linux/arm64 platform. Note: This may produce different binaries than the default linux/amd64."
61+
DOCKER_IMAGE_PLATFORM=linux/arm64
62+
fi
63+
64+
$DOCKER run --platform=${DOCKER_IMAGE_PLATFORM} --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS
5965
# Reset file ownerships for all files docker might touch
60-
$DOCKER run --platform=linux/amd64 --rm $DOCKER_RUN_ARGS -e UID=`id -u` -e GID=`id -g` -v `pwd`:/code $DOCKER_IMAGE bash -c 'chown -R -f $UID:$GID checksums.txt build target'
66+
$DOCKER run --platform=${DOCKER_IMAGE_PLATFORM} --rm $DOCKER_RUN_ARGS -e UID=`id -u` -e GID=`id -g` -v `pwd`:/code $DOCKER_IMAGE bash -c 'chown -R -f $UID:$GID checksums.txt build target'
6167

6268
if [[ "${UPDATE}" = "yes" ]]; then
6369
echo "${CHECKSUM_FILE_PATH} file is updated with latest binary hashes!"

0 commit comments

Comments
 (0)