| name | release |
| description | Prepare, publish, and deploy a cloudflare-dns-operator release. Use when asked to release the project, bump its version, create a release commit and Git tag, push its Docker images, or update its version in the infra repository. |
Release
Create one release from a clean working tree. Keep the Cargo package version, Nix package version, Git tag, and Docker tag aligned.
Run project commands from the repository root through the default Nix development shell.
Select the version
- Use the exact semantic version requested by the user.
- If the user requests a major, minor, or patch bump, calculate it from the version in
Cargo.toml with semver.
- Default to a patch bump when the user does not select a version or bump type.
- Use
X.Y.Z in project files and Docker tags. Use vX.Y.Z for the commit message and Git tag, matching the existing repository history.
Prepare the release
- Run
git status --short. Stop if the working tree contains any change, including untracked files. Do not include unrelated work in a release.
- Confirm that
HEAD is on a branch and that refs/tags/vX.Y.Z does not exist. Never move or replace an existing release tag.
- Update the package version in
Cargo.toml and nix/package.nix.
- Run
nix develop -c cargo check to update Cargo.lock.
- Replace
cargoHash in nix/package.nix with lib.fakeHash.
- Run
nix develop -c nix build '.#image' --no-link. Copy the reported actual hash into cargoHash.
- Run the image build again and require it to pass.
Verify and commit
- Run
nix develop -c just test.
- Run
git diff --check.
- Inspect the full diff. Require exactly these changed files:
Cargo.toml
Cargo.lock
nix/package.nix
- Confirm that all three files contain the selected package version and that
cargoHash is not lib.fakeHash.
- Stage only those three files.
- Create the commit with
git commit -m "vX.Y.Z".
- Create a lightweight tag with
git tag "vX.Y.Z".
- Confirm that the tag resolves to
HEAD and that the working tree is clean.
Publish the Docker image
- Run
nix develop -c just docker-push X.Y.Z. Pass the version explicitly so the recipe does not infer it.
- Require both
robertkrahn/cloudflare-dns-operator:X.Y.Z and robertkrahn/cloudflare-dns-operator:latest to push successfully.
- Report the commit, Git tag, Docker tags, and verification results.
Offer the infra update
After the Docker push succeeds:
- Check these files in order and select the first readable regular file:
~/projects/shuttle/infra/k8s/infrastructure/controllers/cloudflare-dns-operator/cloudflare-dns-operator/kustomization.yaml
~/projects/hyper/infra/k8s/infrastructure/controllers/cloudflare-dns-operator/cloudflare-dns-operator/kustomization.yaml
- Skip this section without error if neither file is available.
- Confirm that the selected file contains the image
robertkrahn/cloudflare-dns-operator and read its current newTag value.
- Offer to change
newTag to X.Y.Z. Name the selected file and show both the current and proposed tags. Do not modify the file until the user agrees.
- After the user agrees, read the infra repository instructions and inspect its Git status. Preserve unrelated changes.
- Change only the
newTag for the selected image. Run the relevant checks defined by the infra repository, then run git diff --check.
- Show the exact diff and offer to commit and push it to the infra repository. Name the current branch and remote. Do not commit or push until the user agrees.
- After the user agrees, stage only the selected file, create the commit with
git commit -m "use cloudflare-dns-operator:X.Y.Z", and push the current branch to its upstream remote.
- Report the infra commit and push result.
Do not push the cloudflare-dns-operator Git branch or tag unless the user asks. Do not amend commits, force-push, delete tags, or discard changes. If Docker publishing fails after the commit and tag exist, preserve them and report the failed command and error.