Skip to content

Commit

Permalink
chore: Only check the bootstrap daemon checksum on release.
Browse files Browse the repository at this point in the history
It's pure toil until then. It's only interesting as part of the release
checklist, not in regular PRs.
  • Loading branch information
iphydf committed Jan 31, 2024
1 parent f70e588 commit 8d29935
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/scripts/tox-bootstrapd-docker
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions other/bootstrap_daemon/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit 8d29935

Please sign in to comment.