Releasing the Aptos TypeScript SDK
Two packages release independently:
@aptos-labs/ts-sdk(packages/ts-sdk/) — tag prefixts-sdk-v@aptos-labs/confidential-asset(packages/confidential-asset/) — tag prefixconfidential-asset-v
All mechanical work is done by scripts/prepareRelease.mjs. Publishing to NPM is done by
.github/workflows/publish.yaml when a GitHub Release is published — never publish by hand.
Preconditions
- Working tree clean, on an up-to-date
main. - The target package's
# Unreleasedchangelog section already lists the changes being released. If it is empty, stop and ask the maintainer to fill it in first (the script will refuse otherwise).
Phase 1 — prepare the release PR
- Ask which package (
ts-sdkorconfidential-asset) unless it is obvious from context. - Ask the bump type:
major,minor, orpatch. For a major bump, remind the maintainer to write an upgrade guide atupgrade-guides/UPGRADE_GUIDE_X.Y.Z.mdand reference it in the changelog. - Determine the new version without mutating anything yet: read
versionfrom the package'spackage.json(packages/ts-sdk/for ts-sdk,packages/confidential-asset/for confidential-asset) and apply the bump. - Create a release branch:
git checkout -b release/<pkg>-v<newVersion>. - Run the prep script:
node scripts/prepareRelease.mjs --package <pkg> --bump <type>
- Validate:
pnpm check- For
ts-sdkonly:pnpm check-version
- Review the diff with
git --no-pager diff. Confirm: the target package'spackage.jsonversion bumped, itsCHANGELOG.mdstamped with today's date, and (ts-sdk)packages/ts-sdk/src/version.ts+ rootdocs/updated. - Commit:
git commit -am "chore: release <pkg> v<newVersion>". - Push and open a PR:
git push -u origin release/<pkg>-v<newVersion>gh pr create --fill --title "chore: release <pkg> v<newVersion>"
- Tell the maintainer to review + merge, then re-invoke this skill for Phase 2.
Phase 2 — tag + GitHub Release (after the PR merges)
git checkout main && git pull --ff-only.- Verify the working tree is clean and the merged version is present:
node -p "require('./<pkgPath>/package.json').version"matches the released version (<pkgPath>ispackages/ts-sdkfor ts-sdk,packages/confidential-assetfor confidential-asset). - Compute the tag:
<pkg>-v<version>. - Refuse if the tag already exists:
git tag --list <tag>must be empty. - Create + push the tag:
git tag -a <tag> -m "<pkg> v<version>"git push origin <tag>
- Create the GitHub Release (this triggers publishing):
- Extract that version's changelog section for the notes.
gh release create <tag> --title "<pkg> v<version>" --notes-file <notes>
- Report the Actions run URL. Note that publishing waits for approval on the
npm-publishenvironment before it pushes to NPM.
Never do
- Never run
npm publish/pnpm publishlocally — CI owns publishing. - Never tag from a dirty tree or a branch other than
main. - Never release with an empty
# Unreleasedsection.