Release SDK
Quick Release
./scripts/release-sdk.sh 0.2.0
This script:
- Regenerates types from
openapi/v1.yaml - Builds the SDK (ESM + CJS + DTS)
- Typechecks
- Validates npm auth
- Creates and pushes the
sdk-v0.2.0git tag - Monitors the GitHub Actions release workflow
- Verifies the package appears on npm
Preflight Only
./scripts/release-sdk.sh --check
Runs steps 1-4 without tagging or publishing. Use after spec changes to verify everything is wired correctly.
Dry Run
./scripts/release-sdk.sh 0.2.0 --dry-run
Builds, sets version, and runs npm pack --dry-run to show what would be published. Does not tag or push.
After Updating the OpenAPI Spec
When endpoints are added or changed in openapi/v1.yaml:
- Regenerate types:
bun run generate:sdk - Build:
cd sdks/typescript && bun install && bun run build - Commit the updated
sdks/typescript/src/types.ts - Release:
./scripts/release-sdk.sh 0.x.y
Do NOT edit sdks/typescript/src/types.ts manually. It's overwritten by the generator.
What the Pipeline Does
git tag sdk-v0.2.0 → push → GitHub Actions triggers:
1. bun install + generate types
2. Verify types match spec (git diff --exit-code)
3. Build SDK (tsup → ESM + CJS + DTS)
4. Set version from tag
5. npm publish --access public
Package Details
| Field | Value |
|---|---|
| Package | @unionstreetai/seed-sdk (change per fork) |
| Registry | npm public |
| Formats | ESM + CJS |
| Runtime dep | openapi-fetch (~5KB) |
| Tag pattern | sdk-v{MAJOR}.{MINOR}.{PATCH} |
| CI secret | NPM_TOKEN (GitHub org secret) |
Initial Release for a New Fork
When setting up a new product forked from seed:
- Update
sdks/typescript/package.json— changenameto@yourorg/your-sdk - Update
sdks/typescript/src/index.ts— change defaultbaseUrl - Regenerate types:
bun run generate:sdk - Ensure
NPM_TOKENis available (inherited from org secret, or set per-repo) - Preflight:
./scripts/release-sdk.sh --check - First release:
./scripts/release-sdk.sh 0.1.0
Version Conventions
0.x.y— pre-1.0, breaking changes allowed between minor versions- Semantic versioning:
MAJOR.MINOR.PATCH(novprefix in the version number; the tag addssdk-v) - The SDK version is independent of the CLI version (
v*tags)
Troubleshooting
"Types are stale" error in CI
The spec was updated but types.ts wasn't regenerated. Run bun run generate:sdk and commit.
npm publish 403
The NPM_TOKEN secret may be expired or missing. Check: gh secret list --org UnionStreetAI | grep NPM
Package name conflict
If the npm package name is taken, change it in sdks/typescript/package.json. Scoped packages (@org/name) are recommended.
If You're Lost
- openapi-typescript docs
- openapi-fetch docs
- npm publish docs
- GitHub Actions: npm publish
- See sdks/typescript/AGENTS.md for SDK architecture
- See openapi/AGENTS.md for spec conventions
- See SECRETS.md for credential management