Publish generated SDKs

1
Enable publishing

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
      }
    }
  }
}
2
Build the SDK

Scalar pushes generated output to scalar-generated, merges it with custom code on scalar-next, and commits the publishing workflows to your repository.

3
Review the release pull request

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.

4
Merge the release

Merging runs release-please.yml. It creates the vX.Y.Z tag, updates CHANGELOG.md, and creates the GitHub Release.

5
Publish the package

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.json and .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.0

Every release gets a vX.Y.Z tag, a GitHub Release, and a CHANGELOG.md entry.

Next steps#

Updated

Was this page helpful?