Skip to content

Latest commit

 

History

History
135 lines (118 loc) · 8.49 KB

RELEASING.md

File metadata and controls

135 lines (118 loc) · 8.49 KB

Releasing cronoq

Releases are cut by pushing a tag vX.Y.Z. The release workflow then checks the tag against the versions, runs cargo test --workspace, builds every artifact, installs and tests the Python wheels on Linux, macOS and Windows, and, once those tests pass, publishes:

  • Rust crates to crates.io (cronoq-core, cronoq, cronoq-proto, cronoq-store-postgres, cronoq-store-sqlite, cronoq-server, cronoq-cli), one at a time in dependency order. Crates with publish = false and versions already on crates.io are skipped, and a publish refused by crates.io's limit on new crates waits 10 minutes and tries again;
  • Python wheels (Linux x86_64/aarch64, macOS x86_64/arm64, Windows x64/arm64) and the sdist to PyPI as cronoq;
  • the TypeScript SDK to GitHub Packages as @synaptiai/cronoq, with a provenance attestation;
  • cronoq-server binaries, wheels, the TypeScript SDK tarball and the packaged Helm charts to a GitHub release, with notes taken from CHANGELOG.md;
  • multi-architecture container images to ghcr.io/synaptiai/cronoq (the server and CLI) and ghcr.io/synaptiai/cronoq-operator;
  • the Helm charts cronoq and cronoq-operator to oci://ghcr.io/synaptiai/charts;
  • the embedded C library to the GitHub release: an archive per platform in two variants (cronoq-embed-<tag>-<target> and cronoq-embed-sqlite-<tag>-<target>), the binary frameworks for Swift (CCronoq.xcframework.zip, CCronoq-sqlite.xcframework.zip) with their checksums, and the Apple size report (cronoq-embed-apple-sizes.md).

The Go client and the Go wrapper of the embedded library are published by their own tags, sdks/go/vX.Y.Z and sdks/go-embed/vX.Y.Z (Go finds a module in a subdirectory by a tag with that prefix).

One-time setup

  1. GitHub environments. Create environments pypi and crates-io under Settings → Environments; add required reviewers if releases should be approved manually.

  2. PyPI trusted publisher. On PyPI, add a trusted publisher for project cronoq (create it as a pending publisher before the first release): owner synaptiai, repository cronoq, workflow release.yml, environment pypi.

  3. crates.io trusted publishing. crates.io can configure trusted publishing only for crates that already exist. For the first release, create an API token on crates.io with the publish-new and publish-update scopes and store it as the secret CARGO_REGISTRY_TOKEN of the crates-io environment (gh secret set CARGO_REGISTRY_TOKEN --env crates-io); the release workflow uses it when present. After the first release, add a trusted publisher to every crate (repository synaptiai/cronoq, workflow release.yml, environment crates-io), then delete the secret and revoke the token.

    A crate added to the workspace later needs the same steps before the release that first includes it: a trusted-publishing token cannot create a crate, and it covers only crates with their own trusted publisher. Without them, the crates job stops at that crate after publishing the crates before it. Publish the new crate's first version by hand (cargo publish -p <crate>, logged in as an owner), add its trusted publisher, then tag the release.

  4. GitHub Packages (npm). The workflow publishes @synaptiai/cronoq with the built-in GITHUB_TOKEN; the repository field of sdks/typescript/package.json links the package to this repository, which is what lets that token publish it. The scope must stay the name of the repository's owner. New packages are private: after the first release, make it public under Packages (installing still needs a token with read:packages; the release tarball does not).

  5. GHCR. The workflow pushes images and charts with the built-in GITHUB_TOKEN; after the first push, make the cronoq, cronoq-operator, charts/cronoq and charts/cronoq-operator container packages public under Packages if desired.

  6. Repository visibility. ARM runners (ubuntu-24.04-arm, windows-11-arm) used by the release workflow are available to public repositories.

  7. Documentation site. Enable GitHub Pages with Settings → Pages → Source: GitHub Actions, then set the repository variable DEPLOY_DOCS to true (Settings → Secrets and variables → Actions → Variables). Until then the Docs workflow builds and link-checks the book but skips the deploy.

Cutting a release

  1. Make sure main is green (CI and benchmarks).

  2. Update the versions:

    • the root Cargo.toml ([workspace.package] version) and the version = "..." of every internal path dependency (cronoq-core in [workspace.dependencies], and every { path = "../cronoq…", version = "..." } in crates/*/Cargo.toml; grep -rn 'path = "../cronoq' crates/*/Cargo.toml lists them), then cargo update -w. The Python package version follows automatically;
    • version in sdks/typescript/package.json (run npm install --package-lock-only there to update its lock file);
    • version and appVersion in deploy/helm/cronoq/Chart.yaml and deploy/helm/cronoq-operator/Chart.yaml.
  3. In CHANGELOG.md, rename ## [Unreleased] content into a new ## [X.Y.Z] - YYYY-MM-DD section, leave an empty ## [Unreleased], and update the comparison links at the bottom.

  4. Commit (Release vX.Y.Z), open a pull request, and merge it after CI passes. Before tagging, run a dry run on the merge commit, and run the server and runtime test suites repeatedly under parallel load to catch timing-dependent failures, for example:

    for i in $(seq 20); do cargo test -q -p cronoq -p cronoq-server -- --test-threads=16 || break; done
  5. Tag and push the release tag alone:

    git tag -s vX.Y.Z -m "cronoq vX.Y.Z"
    git push origin vX.Y.Z
  6. Watch the release workflow. It fails before publishing anything if the tag does not match the crate, TypeScript package and chart versions, if CHANGELOG.md has no matching section, or if cargo test --workspace or a wheel test fails: the jobs that publish crates, wheels, the TypeScript package, container images, Helm charts and the GitHub release all wait for those tests. The release workflow does not run the Go and TypeScript test suites; those run in CI, so main must be green first. It also refuses to publish a TypeScript package version that is already published.

  7. Only after every job of the release workflow has succeeded, tag and push the two Go modules. The Go module proxy records a version the first time anyone fetches it, so the tags cannot be moved afterwards:

    git tag -s sdks/go/vX.Y.Z -m "cronoq Go SDK vX.Y.Z" vX.Y.Z^{commit}
    git tag -s sdks/go-embed/vX.Y.Z -m "cronoq embedded Go wrapper vX.Y.Z" vX.Y.Z^{commit}
    git push origin sdks/go/vX.Y.Z sdks/go-embed/vX.Y.Z

Dry run

Run the workflow manually (Actions → Release → Run workflow) with dry_run enabled to build, test and package every artifact (wheels, binaries, images, the npm tarball and the charts) without publishing.

If something goes wrong

  • crates.io, PyPI and GitHub Packages versions cannot be overwritten. Fix forward with a patch release.
  • A partially published release (for example crates published, PyPI failed) can be completed by re-running the failed jobs of the same workflow run.
  • If crates.io answers 403 Forbidden: The provided access token is not valid for crate <crate>, that crate has no trusted publisher matching the run (owner synaptiai, repository cronoq, workflow release.yml; the workflow name must match exactly). Fix its entry on crates.io, then re-run the failed jobs; crates already published are skipped.
  • A re-run uses the workflow file of the tagged commit, so it cannot pick up a fix to a publish step. If the TypeScript package failed to publish because of such a fix, merge the fix, re-run any other failed publish jobs, then run the Finish release workflow on main with the tag and the run's id (gh workflow run finish-release.yml -f tag=vX.Y.Z -f run_id=<id>). It publishes the run's own package tarball and creates the GitHub release from the run's files, once every crate is on crates.io. Don't move a tag once anything has been published from it.
  • Yank a broken crate with cargo yank --version X.Y.Z <crate>; on PyPI, yank the release from the project's management page; on GitHub Packages, delete the version from the package's page (GitHub refuses once a public version has more than 5,000 downloads).