Deploy & Release
Release tags drive publishing for this repository.
Local Checks
Run verification before preparing a release:
pnpm verifyThe root build includes the CLI package, GUI worker, and documentation site.
Version Bump
Use one of the release scripts:
pnpm release:patch
pnpm release:minor
pnpm release:majorThe script verifies the workspace, bumps versions, commits Release v%s, tags v%s, and pushes the commit and tag.
GitHub Actions Workflow
The release workflow lives at .github/workflows/publish.yml and runs only when a pushed tag matches v*.
The job runs these steps:
- Check out the repository.
- Install pnpm and Node.js 22.
- Install dependencies with
pnpm install --frozen-lockfile. - Read
packages/cli/package.json. - Verify the pushed tag exactly matches the package version, for example tag
v0.2.24for version0.2.24. - Run
pnpm verify. - Copy the root README into the CLI package metadata.
- Publish
@suwujs/king-aito npm with provenance, unless the exact version is already published. - Validate Cloudflare and auth deployment secrets.
- Sync Worker secrets into Cloudflare.
- Deploy the GUI Worker with
pnpm --filter @king-ai/gui-worker run deploy. - Deploy the documentation Worker with
pnpm --filter @king-ai/docs run deploy.
Required GitHub Secrets
The workflow needs these repository secrets:
NPM_TOKEN: npm automation token for publishing@suwujs/king-ai.CLOUDFLARE_ACCOUNT_ID: Cloudflare account ID.CLOUDFLARE_API_TOKEN: Cloudflare API token with Worker deploy and secret-write access.BETTER_AUTH_SECRET: Better Auth secret for the deployed GUI.BETTER_AUTH_URL: public auth URL for the deployed GUI.AUTH_GITHUB_CLIENT_ID: GitHub OAuth client ID.AUTH_GITHUB_CLIENT_SECRET: GitHub OAuth client secret.
GitHub Actions secrets cannot use the GITHUB_ prefix for custom secret names. Store OAuth credentials as AUTH_GITHUB_CLIENT_ID and AUTH_GITHUB_CLIENT_SECRET; the workflow maps them back to Worker secrets named GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET.
Publishing And Deployment Boundaries
GitHub Actions handles npm publish, GUI Worker deployment, and documentation Worker deployment from the pushed release tag. Do not run local npm publish or direct Worker deployment as part of a normal release.
The repository still has local Worker commands such as pnpm gui:deploy and pnpm --filter @king-ai/docs run deploy for targeted maintenance, but production releases should use the tag-driven workflow so package publishing, secret sync, and Worker deploy stay tied to the same verified version.