Skip to content

feat(release): add unified release workflow with release-plz#10457

Open
gustavovalverde wants to merge 4 commits into
mainfrom
worktree-release-phase-2
Open

feat(release): add unified release workflow with release-plz#10457
gustavovalverde wants to merge 4 commits into
mainfrom
worktree-release-phase-2

Conversation

@gustavovalverde
Copy link
Copy Markdown
Member

@gustavovalverde gustavovalverde commented Apr 9, 2026

Motivation

Zebra releases currently follow a 51-item manual checklist taking 4-8 hours, blocking the team via Mergify queue freeze. Publishing uses personal API tokens, and changelogs are manually curated with a known race condition in Release Drafter.

Solution

Add a release-plz pipeline that automates crate publishing and GitHub Release creation.

Release chain

push to main → release.yml
  ├── release-pr (creates/updates Release PR with version bumps + changelogs)
  └── release (publishes crates via trusted publishing + creates GitHub Release)
                    ↓ fires release:released event
release-binaries.yml (existing, unchanged) → Docker Hub
                    ↓ fires release:published event
zfnd-deploy-nodes-gcp.yml (existing, unchanged) → GCP deployment

The release job exits early for non-Release-PR commits (release_always = false). release-binaries.yml stays unchanged — it triggers on the release:released event that release-plz creates.

What this replaces

  • release-drafter.yml → release-plz + git-cliff generate changelogs
  • The 51-item manual checklist → automated with human gate (Release PR review)

Verified locally

release-plz update correctly detects all 12 crates, compares against crates.io, bumps versions from conventional commits, and generates per-crate changelogs.

Tests

The workflow activates on merge to main. Until trusted publishing is configured on crates.io, the release job will succeed but skip crate publishing.

AI Disclosure

  • AI tools were used: Claude for release-plz source code analysis, cliff.toml template debugging, and workflow design.

PR Checklist

  • The PR title follows conventional commits format: type(scope): description
  • The PR follows the contribution guidelines.
  • This change was discussed with the team beforehand.
  • The solution is tested.
  • The documentation and changelogs are up to date.

Replace the manual 51-item release checklist with an automated pipeline.
One workflow handles the entire release: crate publishing via release-plz
with trusted publishing (OIDC), Docker image build, and Docker Hub push.

Job-level permissions isolate secrets — crate publishing (id-token:write)
never shares a job with Docker Hub credentials.

The GCP deployment workflow (zfnd-deploy-nodes-gcp.yml) continues to
trigger independently on the release:published event.
@github-actions github-actions Bot added the C-feature Category: New features label Apr 9, 2026
The zfnd-build-docker-image.yml reusable workflow gates Docker Hub
publishing on `github.event_name == 'release'`. Since our workflow
triggers on `push`, the Docker Hub publish would be silently skipped.

Instead, keep release-binaries.yml as the Docker pipeline — it triggers
on `release: released` events, which release-plz fires when creating
the GitHub Release. The chain is:

  release.yml (push) → publishes crates → creates GitHub Release
  release-binaries.yml (release:released) → Docker Hub
  zfnd-deploy-nodes-gcp.yml (release:published) → GCP deployment
Delete release-drafter.yml workflow and its config — changelog
generation is now handled by release-plz with git-cliff.

Archive the 51-item release checklist as release-checklist-legacy.md
and replace it with a ~20-item checklist for reviewing release-plz
Release PRs.
Copy link
Copy Markdown
Contributor

@mpguerra mpguerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had a quick glance, looks good but didn't reason about it in detail.

Not sure if this should be added to the release workflow but we should find some way to publish the EOS height for zebra (possibly with an estimated EOS date based on height) somewhere visible for end users similar to what is done for zcashd.

@gustavovalverde
Copy link
Copy Markdown
Member Author

@mpguerra the initial work for the EOS date is in the following PR #10459

@gustavovalverde gustavovalverde self-assigned this Apr 15, 2026
@gustavovalverde gustavovalverde added A-devops Area: Pipelines, CI/CD and Dockerfiles C-enhancement Category: This is an improvement labels Apr 15, 2026
@conradoplg
Copy link
Copy Markdown
Collaborator

I'm a bit wary of using release-plz because I had problems with it when I tried. I think it was something like, if it stops in the middle for whatever reason (internet disconnect, etc.) you have to resume it manually. IIRC I think I had problems where a tag was created but the crate was not published, and when trying again it would refuse to publish because the tag already existed, or something similar.

This also does not fully capture our workflow. We use cargo public-api to list API changes to put in the changelog, cargo semver-checks just tells if a major bump is required or not (and can't distinguish between minor and patch releases).

That being said we can try this, just need to be aware of the possible issues.

@arya2 arya2 added the do-not-merge Tells Mergify not to merge this PR label Apr 17, 2026
…n checklist

Install cargo-semver-checks in the release-pr job so release-plz's
API-breaking-change detection actually runs; without the binary on PATH
it logs a warning and leaves no (⚠️ API breaking changes) marker in the
Release PR description.

Set git_release_draft so the GitHub Release stays in Draft after crates
publish. Downstream release-binaries.yml and zfnd-deploy-nodes-gcp.yml
key on released/published events that do not fire for drafts, making
the promote step a human gate before Docker Hub and GCP deploy.

Compress the release checklist from narration to decisions, align the
recovery section with release-plz's verified idempotency behavior
(tag-exists and is-published skip logic in release_plz_core/src/command/release.rs),
and drop redundant re-run scenarios.
@arya2 arya2 removed the do-not-merge Tells Mergify not to merge this PR label Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-devops Area: Pipelines, CI/CD and Dockerfiles C-enhancement Category: This is an improvement C-feature Category: New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants