Please read the Contribution Guide.
Then please sign the Contributor License Agreement.
SDK maintainers should follow semantic versioning best practices for releasing the SDK.
Use your best judgement when deciding on when to craft a release: maybe enough changes have accumulated to warrant a release, maybe there's a high-urgency fix that needs to be published immediately, or maybe you can put it off for a particular feature. It's all dependent on what else is going on.
As you probably already know, there are two main components to the JavaScript SDK environment: the stellar-base
package (this repo) and the higher-level stellar-sdk
package (from here) that relies on this one as a dependency. Care should be taken when updating either, as there are quite a few small steps that can get overlooked.
Once all of the PRs for a particular release are in, it's time to actually publish & deploy a new version.
-
Create a new branch with the new version, e.g.
git switch -C v1.0.0
-
First, look at the diff between the latest release and master: e.g. https://github.com/stellar/js-stellar-base/compare/v5.1.0...master. Replace
v5.1.0
here with the latest release. -
Ensure that all of the PRs in this delta are accurately reflected in the CHANGELOG, broken down by impact and linking to the corresponding PRs. Update the file if necessary.
-
Ensure that the version being deprecated in the
npm_publish.yml
Action matches the latestpackage.json
version: we want to ensure everything instellar-base
gets deprecated, but@stellar/stellar-base
is not. -
Run
yarn preversion
to build and test an optimized bundle and ensure Typescript compatibility (one of the most common sources of bugs, since this library is written purely in JS but must be usable from TS). -
Run
yarn version
to update the version number in the package.json (or modify the"version"
field manually). -
Commit & push your branch, then create a PR.
-
Once approved, merge it and then create a new release, using the same version as you did for the branch; let GitHub create the tag for you. In the description for the release, paste in the relevant parts of the CHANGELOG.
-
Once the release has been created and the build succeeds, the new version should be deployed to
npm
and accessible to all. You can watch this yourself, either via thenpm
page or from the command line:
watch 'curl -s "https://registry.npmjs.org/stellar-base" | jq ".versions | keys | last"'
Refer to the SDK's contributing guide for any additional steps required there.