This document outlines the steps for publishing production and beta releases to NPM.
-
Set Release Versions: Update the version number in the
package.json
files of the CLI, SDK, and root directory. -
Build and Test: Ensure all packages are built and tested.
-
Update Dependencies:
- In
packages/cli/package.json
, replace the wildcard version in dependencies with the specific version you intend to publish. For example, change"@apillon/sdk": "*"
to"@apillon/sdk": "1.0.0"
.
{ ... "dependencies": { ... "@apillon/sdk": "1.0.0" } }
- In
-
Publish Packages: Use
npm publish
to publish each package, starting with the base package that has no internal dependencies (like SDK). -
Revert Changes: Remember to revert the changes made in step 3 before committing to Git!
-
Set Beta Version: Assign the beta release version in the
package.json
files of the CLI and SDK. Use the formatX.Y.Z-beta.V
.{ "version": "1.0.1-beta.0" }
-
Build and Test: Ensure all packages are built and tested.
-
Update Dependencies:
- Similar to the production release, update the internal dependencies in
packages/cli/package.json
to the beta version you are about to publish.
{ ... "dependencies": { ... "@apillon/sdk": "1.0.1-beta.0" ... } }
- Similar to the production release, update the internal dependencies in
-
Publish with Beta Tag: Publish each package with the beta tag using
npm publish --tag beta
, starting with the base package.npm publish --tag beta
-
Update Beta Version: If re-publishing a beta version, increment the beta version tag (e.g.,
1.0.1-beta.1
) and repeat the above steps. -
Revert Changes: Remember to revert the changes made in step 3 before committing to Git!