From 8d29935b7aac141f8e5de7f7ab784d1798eb782d Mon Sep 17 00:00:00 2001 From: iphydf Date: Wed, 31 Jan 2024 18:08:56 +0000 Subject: [PATCH] chore: Only check the bootstrap daemon checksum on release. It's pure toil until then. It's only interesting as part of the release checklist, not in regular PRs. --- .github/scripts/tox-bootstrapd-docker | 3 ++- .github/workflows/docker.yml | 4 +++- other/bootstrap_daemon/docker/Dockerfile | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/scripts/tox-bootstrapd-docker b/.github/scripts/tox-bootstrapd-docker index 4866553722..cfb2cb388c 100755 --- a/.github/scripts/tox-bootstrapd-docker +++ b/.github/scripts/tox-bootstrapd-docker @@ -3,10 +3,11 @@ set -exu -o pipefail LOCAL="${1:-}" +CHECK="${2:-}" readarray -t FILES <<<"$(git ls-files)" -if ! tar c "${FILES[@]}" | docker build -f other/bootstrap_daemon/docker/Dockerfile -t toxchat/bootstrap-node - 2>&1 | tee docker-build.log; then +if ! tar c "${FILES[@]}" | docker build --build-arg="CHECK=$CHECK" -f other/bootstrap_daemon/docker/Dockerfile -t toxchat/bootstrap-node - 2>&1 | tee docker-build.log; then grep -o "::error.*::[a-f0-9]* /usr/local/bin/tox-bootstrapd" docker-build.log false fi diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4d6527c0ae..bcf745c602 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -25,7 +25,9 @@ jobs: with: submodules: recursive - name: Docker Build - run: .github/scripts/tox-bootstrapd-docker local + run: .github/scripts/tox-bootstrapd-docker local "$CHECK" + env: + CHECK: "${{ contains(github.event.pull_request.title, 'chore: Release ') && 'sha256sum' || 'echo' }}" - name: Push latest image to DockerHub if: ${{ github.event_name == 'push' }} run: docker push toxchat/bootstrap-node:latest diff --git a/other/bootstrap_daemon/docker/Dockerfile b/other/bootstrap_daemon/docker/Dockerfile index 9fc0f51707..1cbaf4c0ae 100644 --- a/other/bootstrap_daemon/docker/Dockerfile +++ b/other/bootstrap_daemon/docker/Dockerfile @@ -48,8 +48,9 @@ RUN CC=clang cmake -B_build -H. \ # Verify checksum from dev-built binary, so we can be sure Docker Hub doesn't # mess with your binaries. COPY other/bootstrap_daemon/docker/tox-bootstrapd.sha256 other/bootstrap_daemon/docker/ -RUN SHA256="$(sha256sum /usr/local/bin/tox-bootstrapd)" && \ - (sha256sum -c other/bootstrap_daemon/docker/tox-bootstrapd.sha256 || \ +ARG CHECK=sha256sum +RUN SHA256="$("$CHECK" /usr/local/bin/tox-bootstrapd)" && \ + ("$CHECK" -c other/bootstrap_daemon/docker/tox-bootstrapd.sha256 || \ (echo "::error file=other/bootstrap_daemon/docker/tox-bootstrapd.sha256,line=1::$SHA256" && \ false))