Skip to content

Commit 8d29935

Browse files
committed
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.
1 parent f70e588 commit 8d29935

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.github/scripts/tox-bootstrapd-docker

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
set -exu -o pipefail
44

55
LOCAL="${1:-}"
6+
CHECK="${2:-}"
67

78
readarray -t FILES <<<"$(git ls-files)"
89

9-
if ! tar c "${FILES[@]}" | docker build -f other/bootstrap_daemon/docker/Dockerfile -t toxchat/bootstrap-node - 2>&1 | tee docker-build.log; then
10+
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
1011
grep -o "::error.*::[a-f0-9]* /usr/local/bin/tox-bootstrapd" docker-build.log
1112
false
1213
fi

.github/workflows/docker.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ jobs:
2525
with:
2626
submodules: recursive
2727
- name: Docker Build
28-
run: .github/scripts/tox-bootstrapd-docker local
28+
run: .github/scripts/tox-bootstrapd-docker local "$CHECK"
29+
env:
30+
CHECK: "${{ contains(github.event.pull_request.title, 'chore: Release ') && 'sha256sum' || 'echo' }}"
2931
- name: Push latest image to DockerHub
3032
if: ${{ github.event_name == 'push' }}
3133
run: docker push toxchat/bootstrap-node:latest

other/bootstrap_daemon/docker/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ RUN CC=clang cmake -B_build -H. \
4848
# Verify checksum from dev-built binary, so we can be sure Docker Hub doesn't
4949
# mess with your binaries.
5050
COPY other/bootstrap_daemon/docker/tox-bootstrapd.sha256 other/bootstrap_daemon/docker/
51-
RUN SHA256="$(sha256sum /usr/local/bin/tox-bootstrapd)" && \
52-
(sha256sum -c other/bootstrap_daemon/docker/tox-bootstrapd.sha256 || \
51+
ARG CHECK=sha256sum
52+
RUN SHA256="$("$CHECK" /usr/local/bin/tox-bootstrapd)" && \
53+
("$CHECK" -c other/bootstrap_daemon/docker/tox-bootstrapd.sha256 || \
5354
(echo "::error file=other/bootstrap_daemon/docker/tox-bootstrapd.sha256,line=1::$SHA256" && \
5455
false))
5556

0 commit comments

Comments
 (0)