Install

Releasing ​

One tag vX.Y.Z releases everything. Version 0.1.0 is used in all packages.

ArtifactNameWorkflow
Daemon binaries + checksumsGitHub Releaserelease.yml
Go SDKtag sdk/go/vX.Y.Z, module github.com/thadeu/ndb/sdk/gorelease.yml (last step)
Imageghcr.io/thadeu/ndbimage.yml
npm@thadeu/ndbpublish-npm.yml
Gem (plain client)ndbpublish-gem.yml (pushed first)
Gem (ActiveModel layer)ndb-railspublish-gem.yml (pushed second; depends on ndb ~> 0.1)
Docs siteCloudflare Pages (project ndb-docs, via wrangler)docs.yml

One-time setup ​

  1. npm: create the scope @thadeu if needed. On npmjs.com, open the package @thadeu/ndb (for a first publish, use the account settings to add a trusted publisher, or publish once with a token). Add a trusted publisher: GitHub Actions, owner thadeu, repository ndb, workflow publish-npm.yml. Alternative: set the repository secret NPM_TOKEN; the workflow uses it when it is set.
  2. RubyGems: on rubygems.org, add two pending trusted publishers, one for ndb and one for ndb-rails. Both use owner thadeu, repository ndb, workflow publish-gem.yml. Alternative: set the repository secret GEM_HOST_API_KEY; the workflow uses it when it is set.
  3. Cloudflare Pages: create the project ndb-docs (or let the first wrangler pages deploy create it), attach the custom domain, and add the repo secrets CLOUDFLARE_API_TOKEN (Pages: Edit) and CLOUDFLARE_ACCOUNT_ID.
  4. ghcr: after the first image push, open the package ndb under the profile Packages and set visibility to Public. Link it to the repository.
  5. Settings, Actions, General: allow workflows to have read and write permission (the Go tag step pushes a tag).

Per release ​

  1. Update the version: sdk/ts/package.json, sdk/ruby/lib/ndb/version.rb, sdk/rails/lib/ndb/rails/version.rb. The publish workflows fail when a version differs from the tag. When the ndb minor version changes, update the ndb requirement in sdk/rails/ndb-rails.gemspec.
  2. Move the [Unreleased] entries in CHANGELOG.md to the new version with the date.
  3. Run the checks: go test ./..., and the SDK tests (see development.md).
  4. Merge to main, then:
sh
git tag v0.1.0
git push origin v0.1.0

Verify ​

  • Release: gh release view v0.1.0. Download one archive, check it with sha256sum -c checksums.txt, run ndb -version (prints ndb 0.1.0).
  • Go tag: git ls-remote --tags origin 'sdk/go/*', then in a temp module go get github.com/thadeu/ndb/sdk/[email protected].
  • Image: docker run --rm ghcr.io/thadeu/ndb:0.1.0 -version.
  • npm: npm view @thadeu/ndb version; the package page shows the provenance badge.
  • Gems: gem search -r '^ndb$', gem search -r ndb-rails, or gem install ndb-rails -v 0.1.0 (it installs ndb too).
  • Docs: open the ndb-docs Cloudflare Pages URL (or its custom domain).

If a publish fails ​

A tag cannot be reused for a different build. Fix the cause and re-run the failed workflow in GitHub Actions. If the code must change, use a new patch version. A published npm or gem version cannot be replaced.