Deployment
This guide covers versioning, publishing, CI/CD automation, and local development for the Sellwild SDK across all platforms.
Versioning Strategy
All Sellwild SDK packages share a single version number across every platform. When a release is cut, the following artifacts are published in lockstep:
| Platform | Package |
|---|---|
| Core (JS) | @sellwild/sdk on npm |
| React Native | @sellwild/sdk-react-native on npm |
| iOS | SellwildSDK via SPM and CocoaPods |
| Android | com.sellwild.sdk via Gradle / Maven |
| Flutter | sellwild_sdk on pub.dev |
Use Semantic Versioning (MAJOR.MINOR.PATCH). Increment the version in one place and let CI propagate it to every package manifest.
Per-Platform Publish Instructions
npm (Core + React Native)
Both the core JavaScript package and the React Native wrapper live in the monorepo. Publish them together:
# From the repo root
pnpm version 1.2.0
cd packages/core && pnpm publish --access public
cd ../react-native && pnpm publish --access publicEnsure the @sellwild/sdk-react-native package pins @sellwild/sdk as a peer dependency at the same version.
iOS (SPM + CocoaPods)
Swift Package Manager -- tag the release on the main branch. The Package.swift at the repo root defines the SPM target. Consumers pull by git tag.
git tag 1.2.0
git push origin 1.2.0CocoaPods -- update the podspec version, validate, then push:
# Update SellwildSDK.podspec version field to 1.2.0
pod lib lint SellwildSDK.podspec --allow-warnings
pod trunk push SellwildSDK.podspecThe podspec must reference the same git tag used for SPM so both distribution channels resolve the same source.
Android (Gradle / Maven)
The Android library produces an AAR artifact published to Maven Central under the com.sellwild.sdk group.
cd packages/android
# Set version in build.gradle.kts
./gradlew clean assembleRelease
./gradlew publishReleasePublicationToMavenCentralRepositoryMake sure your ~/.gradle/gradle.properties contains the Sonatype credentials and GPG signing key before publishing.
Flutter (pub.dev)
cd packages/flutter
# Update version in pubspec.yaml
dart pub publish --dry-run # verify first
dart pub publishThe Flutter package depends on the iOS and Android native libraries via platform channels. Confirm those artifacts are already available before publishing to pub.dev.
CI/CD with GitHub Actions
A single GitHub Actions workflow can automate the entire release. The following example triggers on version tags:
name: Release SDK
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org
- run: pnpm install --frozen-lockfile
- run: pnpm -C packages/core publish --access public --no-git-checks
- run: pnpm -C packages/react-native publish --access public --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- run: pod lib lint SellwildSDK.podspec --allow-warnings
- run: pod trunk push SellwildSDK.podspec
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
publish-android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- run: cd packages/android && ./gradlew publishReleasePublicationToMavenCentralRepository
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
publish-flutter:
runs-on: ubuntu-latest
needs: [publish-ios, publish-android]
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
- run: cd packages/flutter && dart pub publish --force
env:
PUB_TOKEN: ${{ secrets.PUB_DEV_TOKEN }}The Flutter job depends on the iOS and Android jobs because its platform channels require the native artifacts to be available first.
Local Development Linking
During development you can link local packages so changes are reflected immediately without publishing.
npm (Core + React Native)
cd packages/core && pnpm link --global
cd ../react-native && pnpm link --global
# In your consuming app
pnpm link --global @sellwild/sdk @sellwild/sdk-react-nativeiOS (SPM local package)
In your Xcode project, drag the packages/ios directory into the project navigator. Xcode resolves it as a local Swift package, overriding any remote dependency.
Android (composite build)
Add the SDK as a composite build in your app's settings.gradle.kts:
includeBuild("../sellwild-sdk/packages/android") {
dependencySubstitution {
substitute(module("com.sellwild.sdk:sellwild-sdk")).using(project(":"))
}
}Flutter (path dependency)
# In your app's pubspec.yaml
dependencies:
sellwild_sdk:
path: ../sellwild-sdk/packages/flutterPre-Release Checklist
Before cutting a release, verify every item below:
- [ ] All platform test suites pass (
pnpm test,xcodebuild test,./gradlew test,flutter test). - [ ] Version number is updated in every manifest (
package.jsonx2,SellwildSDK.podspec,build.gradle.kts,pubspec.yaml). - [ ] CHANGELOG entry exists for the new version.
- [ ] The validation report (
/guide/validation) reflects the latest build output. - [ ] API documentation is regenerated if public interfaces changed.
- [ ] A draft GitHub Release is created with release notes summarizing changes.
- [ ] Smoke-test the SDK in a clean sample app on each platform before promoting the release from draft to published.