This document describes the step-by-step process for releasing a new version of the Purchasely React Native SDK. Publishing to npm is automated via CI — creating a GitHub release triggers the publish workflow.
- Node.js v20+ (see
.nvmrc) - Yarn 3.6.1+
ghCLI authenticated with push access to the repository- npm Trusted Publishers configured (see npm Setup — one-time only)
git checkout main
git pull origin main
git checkout -b version/{VERSION}Update the Purchasely iOS SDK version in:
packages/purchasely/react-native-purchasely.podspec (line ~23):
s.dependency "Purchasely", '{IOS_VERSION}'Update the Purchasely Android SDK version in all 5 build.gradle files:
| File | Dependency |
|---|---|
packages/purchasely/android/build.gradle |
api 'io.purchasely:core:{ANDROID_VERSION}' |
packages/google/android/build.gradle |
implementation 'io.purchasely:google-play:{ANDROID_VERSION}' |
packages/amazon/android/build.gradle |
implementation 'io.purchasely:amazon:{ANDROID_VERSION}' |
packages/huawei/android/build.gradle |
implementation 'io.purchasely:huawei-services:{ANDROID_VERSION}' |
packages/android-player/android/build.gradle |
implementation 'io.purchasely:player:{ANDROID_VERSION}' |
./prepare.sh {VERSION}This script updates:
- Version in all
package.jsonfiles (purchasely, google, huawei, amazon, android-player) - Cross-package dependency references
purchaselyVersionconstant inpackages/purchasely/src/index.ts- Builds all packages with
yarn all:prepare
Add a new row to VERSIONS.md:
| {VERSION} | {IOS_VERSION} | {ANDROID_VERSION} |Replace all occurrences of the old version string with {VERSION} in:
packages/purchasely/src/__tests__/index.test.ts(~lines 185, 206)packages/purchasely/src/__tests__/types.test.ts(~lines 331, 342)
Update version references in CLAUDE.md:
- Properties table (Current Version, Native iOS SDK, Native Android SDK)
- Native Dependencies section (iOS SDK version, Android core version)
- Version Compatibility table
yarn installThis ensures yarn.lock reflects any dependency changes.
yarn test
yarn lint
yarn typecheckgit add .
git commit -m "chore: Bump package versions to {VERSION}"
git push -u origin version/{VERSION}gh pr create --base main --title "Version {VERSION}" --body "..."Wait for all CI checks to pass:
- lint
- test
- build-android
- build-ios
After CI passes and PR is approved:
gh pr merge --mergegit checkout main
git pull origin main
gh release create {VERSION} --target main --title "{VERSION}" --notes "## React Native SDK {VERSION}
### Native SDK updates
- **iOS SDK:** {OLD_IOS} → {IOS_VERSION}
- **Android SDK:** {OLD_ANDROID} → {ANDROID_VERSION}
"This automatically triggers .github/workflows/publish.yml which:
- Runs the full CI pipeline (lint, test, build-android, build-ios)
- Verifies all package.json versions match the release tag
- Publishes all 5 packages to npm with OIDC provenance
npm view react-native-purchasely version
npm view @purchasely/react-native-purchasely-google version
npm view @purchasely/react-native-purchasely-amazon version
npm view @purchasely/react-native-purchasely-huawei version
npm view @purchasely/react-native-purchasely-android-player versionAll should return {VERSION}.
| Package | npm |
|---|---|
react-native-purchasely |
npmjs.com |
@purchasely/react-native-purchasely-google |
npmjs.com |
@purchasely/react-native-purchasely-amazon |
npmjs.com |
@purchasely/react-native-purchasely-huawei |
npmjs.com |
@purchasely/react-native-purchasely-android-player |
npmjs.com |
| File | Changes |
|---|---|
packages/purchasely/package.json |
Version number |
packages/purchasely/src/index.ts |
purchaselyVersion constant |
packages/google/package.json |
Version + purchasely dependency |
packages/huawei/package.json |
Version + purchasely dependency |
packages/amazon/package.json |
Version + purchasely dependency |
packages/android-player/package.json |
Version number |
packages/purchasely/react-native-purchasely.podspec |
iOS SDK version (if updated) |
packages/purchasely/android/build.gradle |
Android SDK version (if updated) |
packages/google/android/build.gradle |
Android SDK version (if updated) |
packages/amazon/android/build.gradle |
Android SDK version (if updated) |
packages/huawei/android/build.gradle |
Android SDK version (if updated) |
packages/android-player/android/build.gradle |
Android SDK version (if updated) |
VERSIONS.md |
Version mapping table |
CLAUDE.md |
Version references in properties and docs |
packages/purchasely/src/__tests__/index.test.ts |
Test version expectations |
packages/purchasely/src/__tests__/types.test.ts |
Test version expectations |
yarn.lock |
Dependency lock file |
One-time setup per package. Already configured — only needed if adding a new package.
For each package, go to https://www.npmjs.com/package/<PACKAGE_NAME>/access:
- Section Trusted Publishers → GitHub Actions
- Repository owner:
Purchasely - Repository name:
Purchasely-ReactNative - Workflow filename:
publish.yml - Environment: (leave empty)
The yarn.lock file wasn't updated after changing dependencies. Run:
yarn install
git add yarn.lock
git commit --amend --no-edit
git push --force-with-leaseThe CI needs --repo-update to fetch the latest pod specs. This is already configured in .github/workflows/ci.yml. If running locally:
cd example/ios
pod install --repo-updateUpdate the hardcoded version strings in the test files (see Step 5).
- Verify Trusted Publisher is configured on npmjs.com for the failing package
- Ensure the workflow filename matches exactly:
publish.yml - Ensure the repository name matches:
Purchasely/Purchasely-ReactNative
The release tag must match exactly the version in all package.json files. Release tags should be bare versions (e.g., 5.7.2), not prefixed with v.
- Always update tests when bumping versions to avoid CI failures
- Run full test suite locally before pushing to catch issues early
- Update CLAUDE.md alongside version bumps to keep docs in sync
- Update VERSIONS.md to maintain the version history for documentation
- Use semantic versioning:
- MAJOR: Breaking API changes
- MINOR: New features, backward compatible
- PATCH: Bug fixes, backward compatible