Skip to content

Merge pull request #2 from thinkgrid-labs/dev #18

Merge pull request #2 from thinkgrid-labs/dev

Merge pull request #2 from thinkgrid-labs/dev #18

name: Release React Native SDK
# Triggered by version tags: v1.2.3
on:
push:
tags: ["v*.*.*"]
# The React Native SDK ships JS + C++/Rust source files to npm.
# Native compilation (JSI .so / .a) happens inside the consuming app's
# Xcode / Gradle build via the included CMakeLists.txt / Podspec,
# so no cross-compilation matrix is required here.
jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org
- name: Set version from tag
working-directory: sdks/react-native
run: |
TAG="${{ github.ref_name }}"
VERSION="${TAG#v}"
npm version "$VERSION" --no-git-tag-version --allow-same-version
- name: Validate package integrity
working-directory: sdks/react-native
run: |
# Manually trigger bundling to ensure it works in CI environment
node scripts/bundle-rust.js
# Check for critical files that must be in the npm package
if [ ! -d "rust-core/src" ]; then echo "Error: rust-core source missing!"; exit 1; fi
if [ ! -f "Checkgate.podspec" ]; then echo "Error: Podspec missing!"; exit 1; fi
if [ ! -d "android/src/main" ]; then echo "Error: Android configuration missing!"; exit 1; fi
echo "Package integrity verified."
- name: Publish @checkgate/react-native
working-directory: sdks/react-native
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}