Skip to content

ci: Publish binaries and Docker images on release - #6736

Open
mangas wants to merge 8 commits into
mangas/release-pleasefrom
mangas/release-publish
Open

mangas wants to merge 8 commits into
mangas/release-pleasefrom
mangas/release-publish

Conversation

@mangas

@mangas mangas commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #6734 (release-please). When release-please cuts a release, this publishes binaries and Docker images. It also replaces the Google Cloud Build setup.

Binaries (.github/workflows/publish.yml): builds graph-node for x86_64 and aarch64 Linux, cross-compiling the latter, and attaches the gzipped binaries and a SHA256SUMS file to the release.

  • It can be run by hand with tag_name and dry_run. A dry run uploads the bundle as a workflow artifact and leaves the release untouched.
  • It uses GITHUB_TOKEN only.

Docker images (.github/workflows/docker.yml): builds the graph-node and graph-node-debug targets of docker/Dockerfile for linux/amd64, with the same build args and tags as docker/tag.sh:

Build Tags
every build 7-char short SHA
push to master nightly
release (called from release.yml) vX.Y.Z, latest
  • Images always go to ghcr.io/graphprotocol/graph-node and ghcr.io/graphprotocol/graph-node-debug.
  • If DOCKERHUB_USERNAME and DOCKERHUB_TOKEN are set, the same tags also go to Docker Hub graphprotocol/graph-node(-debug). Without the token, the "Log in to Docker Hub" step shows as skipped and the images go to ghcr only. Tags come from docker/metadata-action.
  • docker-compose.yml and docker/README.md keep the Docker Hub name.

Removed: docker/cloudbuild.yaml and docker/tag.sh. Cloud Build is still pushing to Docker Hub today, so its trigger should be disabled when this merges.

Before this leaves draft:

  1. Add DOCKERHUB_USERNAME and DOCKERHUB_TOKEN as repository secrets, for an account with push access to graphprotocol/*. Cloud Build pushed as lutter.
  2. After the first push, set the two ghcr packages to public. If they already exist in the org, give this repo write access to them.
  3. Nothing here has run on a real runner yet. The first test can be publish.yml by hand with dry_run: true, plus docker.yml by hand from this branch, which pushes only short-SHA tags.

Known and left as is:

  • A release commit is built twice, once from the master push (nightly) and once from the release (vX.Y.Z, latest); Cloud Build did the same.
  • nightly has no concurrency guard, so two master pushes close together can finish out of order.

mangas and others added 7 commits October 12, 2026 12:16
Releases attach x86_64 and aarch64 Linux binaries (publish.yml) and push the
graph-node and graph-node-debug images (docker.yml), which also build nightly
from master. Images go to ghcr.io/graphprotocol and, when DOCKERHUB_USERNAME
and DOCKERHUB_TOKEN are set, to Docker Hub with the same tags. This replaces
the Google Cloud Build setup (docker/cloudbuild.yaml, docker/tag.sh).
…ages

Docker Hub is where users and deployments pull graph-node from, so a build
that can't push there now fails instead of publishing to ghcr.io alone:
it logs in with the organisation's access token (org secret
DOCKERHUB_CI_TOKEN, user graphprotocol).

Cover what the Cloud Build triggers built: `canary-*` tags get an image
tagged with the tag's name, and hotfix/** branches the short SHA.

Also: one build per ref at a time, a release in its own group so a
nightly can't replace it; build provenance for both images; YAML anchors
written out. CONTRIBUTING describes the tags and how to get a canary.
Fail when graph-node needs libpq on the host: it is linked statically
only because gnd's pq-sys `bundled` feature is unified into the build.
Run the cross-built aarch64 binary under qemu-user instead of only
checking its architecture. Attest the release archives' build provenance;
release.yml grants id-token and attestations to the called workflows.
release-please's release commit was built twice: by its push to master
(nightly) and by the release. The two images differ, and the short-SHA
tag went to whichever finished last, so it could name the nightly image
instead of vX.Y.Z (seen in a rehearsal). Skip the push build for the
release commit; nightly stays on the commit before it.
@mangas

mangas commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

Not needed anymore; closing.

@mangas mangas closed this Nov 27, 2026
@cjorge-thegraph

Copy link
Copy Markdown

Reopening together with #6734; see the comment there for the follow-up commits.

@cjorge-thegraph
cjorge-thegraph marked this pull request as ready for review November 27, 2026 20:48

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants