Skip to main content

Module release_local

Module release_local 

Source
Expand description

Releasing without GitHub Actions ([release] mode = "local").

On a repository whose Actions never run, auto-tag.yml and release.yml never fire, so nothing tags or publishes after the release pull request merges. In local mode crate::release_watch merges that pull request on the owner’s approval and then drives the Job defined here, from a clean detached checkout of the merge commit:

  1. create and push the vX.Y.Z tag - never over a tag that exists (tag_step is the whole decision);
  2. run [release] commands one at a time, stopping at the first failure.
  • Progress is saved before every step, through the caller’s save. A step that was started and never finished (a crash, a kill) is Job::interrupted: magi cannot know whether gh release create got as far as the forge, so it holds for the owner instead of repeating it.
  • A failure is a hold, not a retry. run_job returns the reason; the watcher records it, raises a notice and asks. Resuming skips the tag and every command that already succeeded.
  • Environment, not templates. Commands see MAGI_RELEASE_VERSION, MAGI_RELEASE_TAG, MAGI_RELEASE_COMMIT and MAGI_RELEASE_PR; teravars renders the whole config before any release exists, so {{ version }} cannot work.
  • Only git and the commands the operator wrote run; there is no API path.

Structs§

Env
Where and how a job runs.
Job
One release of one merged pull request, resumable.
StepLog
What happened in one step, kept in the record.

Enums§

TagStep
What to do about the tag. Pure.

Constants§

BRANCH_PREFIX
Head of a release branch name, before the version.

Functions§

job_dir
Where a job keeps its worktree and full command output.
parse_ls_remote
The commit tag peels to, out of git ls-remote --tags <remote> refs/tags/<tag> refs/tags/<tag>^{}. The peeled line wins over the tag object’s own.
run_job
Drive job to the end or to the first failure. Err carries the reason it stopped; the job itself already says how far it got. Never retries.
tag_step
Decide the tag step from what was read. remote is the commit the remote’s tag peels to (Ok(None): absent), or the reason it could not be read; local is the commit of a local tag of that name.
tail
Last max bytes of s, on a character boundary.
version_from_branch
1.2.3 out of chore/release-v1.2.3.

Type Aliases§

Save
Persists the job; false means it could not be, and nothing may run.