Publish generated SDKs
Turn on Publish to <registry> on merge in the target's Git settings, or add a publish block to its configuration.
{
"targets": {
"typescript": {
"packageName": "demo-api",
"publish": {
"npm": true
}
}
}
}Scalar pushes generated output to scalar-generated, merges it with custom code on scalar-next, and commits the publishing workflows to your repository.
Scalar opens a release pull request from scalar-next against your default branch. The diff includes generated changes, custom code, the changelog, and the version bump.
Merging runs release-please.yml. It creates the vX.Y.Z tag, updates CHANGELOG.md, and creates the GitHub Release.
The workflow checks out the new tag and publishes the package to its registry. The publish step is idempotent, so a package version already on the registry is skipped.
Generated publishing files#
A linked target receives ordinary files that you can inspect in the repository:
.github/workflows/sdk-ci.yml— Builds the SDK on pushes and pull requests..github/workflows/release-please.yml— Creates releases and runs the publish job..github/workflows/release-title-edit.yml— Re-renders a release when its title specifies a version..github/workflows/sdk-release.yml— Manually republishes an existing tag when the target publishes at release time.release-please-config.jsonand.release-please-manifest.json— Release configuration and version state.VERSIONING.md— The branch model, version selection, and repository prerequisites.
Tag-served ecosystems such as Swift Package Manager and Packagist have no upload job. Their tag and GitHub Release are the published result.
Registry authentication#
Scalar uses OIDC trusted publishing where the registry supports it. Register release-please.yml as the trusted publisher workflow because the automated publish runs inside it.
Registries without OIDC support use repository secrets. Maven Central also requires GPG signing.
Choose a version#
Versions come from Conventional Commits and the commit history. To choose an exact version, edit the release pull request title:
release: 1.0.0Every release gets a vX.Y.Z tag, a GitHub Release, and a CHANGELOG.md entry.