Skip to content

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:

PlatformPackage
Core (JS)@sellwild/sdk on npm
React Native@sellwild/sdk-react-native on npm
iOSSellwildSDK via SPM and CocoaPods
Androidcom.sellwild.sdk via Gradle / Maven
Fluttersellwild_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:

bash
# From the repo root
pnpm version 1.2.0
cd packages/core && pnpm publish --access public
cd ../react-native && pnpm publish --access public

Ensure 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.

bash
git tag 1.2.0
git push origin 1.2.0

CocoaPods -- update the podspec version, validate, then push:

bash
# Update SellwildSDK.podspec version field to 1.2.0
pod lib lint SellwildSDK.podspec --allow-warnings
pod trunk push SellwildSDK.podspec

The 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.

bash
cd packages/android
# Set version in build.gradle.kts
./gradlew clean assembleRelease
./gradlew publishReleasePublicationToMavenCentralRepository

Make sure your ~/.gradle/gradle.properties contains the Sonatype credentials and GPG signing key before publishing.

Flutter (pub.dev)

bash
cd packages/flutter
# Update version in pubspec.yaml
dart pub publish --dry-run   # verify first
dart pub publish

The 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:

yaml
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)

bash
cd packages/core && pnpm link --global
cd ../react-native && pnpm link --global
# In your consuming app
pnpm link --global @sellwild/sdk @sellwild/sdk-react-native

iOS (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:

kotlin
includeBuild("../sellwild-sdk/packages/android") {
    dependencySubstitution {
        substitute(module("com.sellwild.sdk:sellwild-sdk")).using(project(":"))
    }
}

Flutter (path dependency)

yaml
# In your app's pubspec.yaml
dependencies:
  sellwild_sdk:
    path: ../sellwild-sdk/packages/flutter

Pre-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.json x2, 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.

Sellwild SDK Documentation