Skip to content

Estate releases

rab.yml releases the packages of one repository. An estate release ships packages that live in several repositories, in order, from one place: a release repository (for IntentumDiff, buchochelliq-labs/intentumdiff-release) holding a manifest, release.json, and a gated workflow that runs release.py estate release.

Nothing is rebuilt. The manifest pins what each package ships: the release-branch CI run, its source commit and the SHA-256 of every artifact. Each package's own publish.yml still does the publishing (PyPI Trusted Publishing and the Marketplace tokens stay in that repository); estate release creates its tag and dispatches that workflow with every pin as an input.

Two ways to release a package

Releasing from a package's own repository keeps working. The two are told apart by the tag and by the run name:

Repo release Orchestrated release
Started by pushing a v* tag in the package repository the release repository's Release workflow
Tag lightweight, or annotated by hand annotated, ending Release-Orchestrator: <that run's URL>
Pins from that repository's own variables release.json, passed as dispatch inputs
Publish run name Release v0.0.3b2 Orchestrated release of v0.0.3b2 (<run URL>)
The tag's own push publishes does nothing (deferred), so one tag cannot publish twice

The release repository owns the decision and every pin. A package's publish.yml only reads the tag's marker, in the shell step rab ships as estate/release_mode_step.sh (installed at .github/rab/estate/release_mode_step.sh). The workflow embeds it verbatim, under a step named Read the tag's Release-Orchestrator marker, and declares the contract intentumdiff-release-contract: 1. estate plan and estate release refuse a package whose step differs, because it could not tell the two kinds of release apart. They also refuse to touch a tag that already exists as a repo release.

release.json

{
  "release": "0.0.3b2",
  "packages": [
    {
      "name": "intentumdiff-python",
      "repo": "buchochelliq-labs/intentumdiff-python",
      "kind": "pypi-wheels",
      "distribution": "intentumdiff-python",
      "version": "0.0.3b2",
      "tag": "v0.0.3b2",
      "branch": "main",
      "rc_branch": "release/v0.0.3-rc",
      "workflow": "publish.yml",
      "pins": null
    }
  ]
}
Key Meaning
release the estate release's name
packages released in this order
name unique in the manifest
repo buchochelliq-labs/<name>
kind pypi-wheels or vsix (below)
version X.Y.Z, optionally with aN, bN or rcN
tag v<version>
branch the branch the release is tagged on (main)
rc_branch the release branch the pinned CI run tested (default release/vX.Y.Z-rc)
workflow the package's publish workflow file (publish.yml)
distribution pypi-wheels: the PyPI name (default name)
vsix_name vsix: the file name before -<version>.vsix (default intentumdiff)
open_vsx vsix: <namespace>/<name> on Open VSX, to check the release there
pins written by estate pin; null until then

Package kinds

pypi-wheels pins four platform wheels (ubuntu-latest, macos-latest, windows-latest, windows-11-arm) from the candidate-evidence-<platform>-<attempt> artifacts of one push run of CI on the release branch. For each, pin checks that the archive is the bytes GitHub's digest records, that it holds exactly one wheel of this distribution and version for that platform, and that the run's own evidence records the wheel's SHA-256 (evidence/wheels.sha256), the tested commit (python-tested-commit.txt), the release build profile and one core commit shared by every platform. Dispatch inputs: candidate_run_id, candidate_source_sha, candidate_core_sha, candidate_wheels_json. Released means PyPI serves exactly the pinned wheels; other wheels under the version are a refusal.

vsix pins the rc-candidate-vsix artifact of one push run of Packaged extension real-runtime acceptance, and that run's rc-release-media. The media must have been built by scripts/build_release_media.py with status captured, for the same version, commit, run and VSIX, with every image matching its manifest. Pinning is the media approval: pin prints a link to the media artifact; look at every image before merging the pin. Dispatch inputs: candidate_run_id, candidate_artifact_id, candidate_sha256, candidate_source_sha, candidate_media_artifact_id, candidate_media_sha256. Released means Open VSX serves the version.

Every kind refuses a run that is not a successful push run on the release branch, or has a job that did not pass.

Commands

Every command but step takes --manifest FILE (default release.json at the repository root). They need no PyYAML. They reach GitHub with the token in GH_TOKEN (or GITHUB_TOKEN), else the GitHub CLI's (gh auth token).

estate check, estate repositories

check validates the manifest (and the shape of every pin). repositories prints the repositories it names, comma-separated and without the owner, for actions/create-github-app-token's repositories input.

estate pin

release.py estate pin NAME --run RUN_ID [--dry-run]

Pins NAME to CI run RUN_ID, checked as above, and writes its pins into the manifest. Commit that in a PR; review and merge it.

estate plan

Read-only. For each pinned package: branch has the reviewed tree (the pinned commit's), publish.yml there embeds rab's step, every pinned artifact is unexpired and from the pinned run, and the tag is absent or made by an orchestrated release (a repo-release tag is a refusal).

estate release

release.py estate release --orchestrator-run URL [--package NAME] [--dry-run] [--wait-minutes N]

URL is the run of the release repository's workflow doing it. For each pinned package, in order:

  1. skip it if the registry already serves the pinned bytes;
  2. run every plan check;
  3. create the annotated tag on branch's head, ending Release-Orchestrator: URL (a tag an earlier orchestrated run made is reused);
  4. dispatch publish.yml on the tag with every pin, dry_run and orchestrator_run as inputs;
  5. wait for that run (--wait-minutes, default 120) to succeed;
  6. wait until the registry serves the pinned bytes.

--dry-run tags nothing and dispatches on branch with dry_run: true, so publish.yml verifies its pins (orchestrated-dry-run). Lines go to the job summary too, ending with **Refused:** and the reason on a refusal.

estate step

release.py estate step [--workflow FILE]

Prints the canonical release-mode step. With --workflow, rewrites the body of that workflow's Read the tag's Release-Orchestrator marker step (run: |) to the canonical step, so nobody copies it by hand. The workflow must already declare intentumdiff-release-contract: 1 and have that step.

The release repository's workflow

The release repository installs rab like any other repository (release.py install, which also writes .github/rab/estate/) and runs it from .github/rab/. Its Release workflow runs in an environment with required reviewers, mints a GitHub App token scoped to the repositories the manifest names, and calls estate release:

- name: Validate release.json
  id: manifest
  run: |
    python3 .github/rab/scripts/release.py vendored
    python3 .github/rab/scripts/release.py estate check
    echo "repositories=$(python3 .github/rab/scripts/release.py estate repositories)" >> "$GITHUB_OUTPUT"
- name: Mint the release App's token
  id: app-token
  uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
  with:
    client-id: ${{ vars.RELEASE_APP_CLIENT_ID || secrets.RELEASE_APP_CLIENT_ID }}
    private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
    owner: ${{ github.repository_owner }}
    repositories: ${{ steps.manifest.outputs.repositories }}
    permission-contents: write
    permission-actions: write
- name: Release
  env:
    GH_TOKEN: ${{ steps.app-token.outputs.token }}
    ORCHESTRATOR_RUN: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
  run: python3 .github/rab/scripts/release.py estate release --orchestrator-run "$ORCHESTRATOR_RUN"

The App needs Contents: read and write (tags), Actions: read and write (dispatch and read publish.yml runs) and Metadata: read, on the package repositories only. Tags it creates start workflows, unlike tags made with GITHUB_TOKEN; the release-mode step defers those runs.