Releasing
One tag vX.Y.Z releases everything. Version 0.1.0 is used in all packages.
| Artifact | Name | Workflow |
|---|---|---|
| Daemon binaries + checksums | GitHub Release | release.yml |
| Go SDK | tag sdk/go/vX.Y.Z, module github.com/thadeu/ndb/sdk/go | release.yml (last step) |
| Image | ghcr.io/thadeu/ndb | image.yml |
| npm | @thadeu/ndb | publish-npm.yml |
| Gem (plain client) | ndb | publish-gem.yml (pushed first) |
| Gem (ActiveModel layer) | ndb-rails | publish-gem.yml (pushed second; depends on ndb ~> 0.1) |
| Docs site | Cloudflare Pages (project ndb-docs, via wrangler) | docs.yml |
One-time setup
- npm: create the scope
@thadeuif 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, ownerthadeu, repositoryndb, workflowpublish-npm.yml. Alternative: set the repository secretNPM_TOKEN; the workflow uses it when it is set. - RubyGems: on rubygems.org, add two pending trusted publishers, one for
ndband one forndb-rails. Both use ownerthadeu, repositoryndb, workflowpublish-gem.yml. Alternative: set the repository secretGEM_HOST_API_KEY; the workflow uses it when it is set. - Cloudflare Pages: create the project
ndb-docs(or let the firstwrangler pages deploycreate it), attach the custom domain, and add the repo secretsCLOUDFLARE_API_TOKEN(Pages: Edit) andCLOUDFLARE_ACCOUNT_ID. - ghcr: after the first image push, open the package
ndbunder the profile Packages and set visibility to Public. Link it to the repository. - Settings, Actions, General: allow workflows to have read and write permission (the Go tag step pushes a tag).
Per release
- 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 thendbminor version changes, update thendbrequirement insdk/rails/ndb-rails.gemspec. - Move the
[Unreleased]entries inCHANGELOG.mdto the new version with the date. - Run the checks:
go test ./..., and the SDK tests (see development.md). - Merge to
main, then:
sh
git tag v0.1.0
git push origin v0.1.0Verify
- Release:
gh release view v0.1.0. Download one archive, check it withsha256sum -c checksums.txt, runndb -version(printsndb 0.1.0). - Go tag:
git ls-remote --tags origin 'sdk/go/*', then in a temp modulego 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, orgem install ndb-rails -v 0.1.0(it installsndbtoo). - Docs: open the
ndb-docsCloudflare 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.