chore: bump versions #282
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| branches: [main, develop] | |
| workflow_call: | |
| jobs: | |
| # Detect which files changed to conditionally run jobs | |
| changes: | |
| name: Detect Changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| library: ${{ steps.filter.outputs.library }} | |
| mcp-server: ${{ steps.filter.outputs.mcp-server }} | |
| docs: ${{ steps.filter.outputs.docs }} | |
| deps: ${{ steps.filter.outputs.deps }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for changes | |
| uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| library: | |
| - 'packages/react-native-nitro-device-info/src/**' | |
| - 'packages/react-native-nitro-device-info/ios/**' | |
| - 'packages/react-native-nitro-device-info/android/**' | |
| - 'packages/react-native-nitro-device-info/nitrogen/**' | |
| - 'packages/react-native-nitro-device-info/package.json' | |
| - 'packages/react-native-nitro-device-info/tsconfig.json' | |
| - 'packages/react-native-nitro-device-info/babel.config.js' | |
| - 'example/**' | |
| mcp-server: | |
| - 'packages/mcp-server/**' | |
| docs: | |
| - 'docs/**' | |
| deps: | |
| - 'package.json' | |
| - 'yarn.lock' | |
| - name: Debug outputs | |
| run: | | |
| echo "library=${{ steps.filter.outputs.library }}" | |
| echo "mcp-server=${{ steps.filter.outputs.mcp-server }}" | |
| echo "docs=${{ steps.filter.outputs.docs }}" | |
| echo "deps=${{ steps.filter.outputs.deps }}" | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: ${{ needs.changes.outputs.library == 'true' || needs.changes.outputs.mcp-server == 'true' || needs.changes.outputs.deps == 'true' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Run oxlint | |
| run: yarn lint | |
| - name: Run TypeScript type check | |
| run: yarn typecheck | |
| build: | |
| name: Build Library | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: ${{ needs.changes.outputs.library == 'true' || needs.changes.outputs.deps == 'true' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Build TypeScript | |
| run: yarn prepare | |
| - name: Verify build outputs | |
| run: | | |
| test -d packages/react-native-nitro-device-info/lib/module || exit 1 | |
| test -d packages/react-native-nitro-device-info/lib/typescript || exit 1 | |
| test -d packages/react-native-nitro-device-info/nitrogen/generated || exit 1 | |
| build-ios: | |
| name: Build iOS | |
| runs-on: macos-15 | |
| needs: changes | |
| if: ${{ needs.changes.outputs.library == 'true' || needs.changes.outputs.deps == 'true' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'yarn' | |
| - name: Cache CocoaPods downloads | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/Library/Caches/CocoaPods | |
| key: pods-download-${{ runner.os }}-${{ hashFiles('example/showcase/package.json') }} | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Build library | |
| run: yarn prepare | |
| - name: Install example dependencies | |
| working-directory: example/showcase | |
| run: yarn install --immutable | |
| - name: Install Pods | |
| working-directory: example/showcase/ios | |
| run: pod install | |
| - name: Build iOS app | |
| working-directory: example/showcase | |
| run: | | |
| xcodebuild \ | |
| -workspace ios/NitroDeviceInfoExample.xcworkspace \ | |
| -scheme NitroDeviceInfoExample \ | |
| -configuration Release \ | |
| -sdk iphonesimulator \ | |
| -derivedDataPath ios/build \ | |
| -quiet \ | |
| CODE_SIGNING_ALLOWED=NO | |
| build-android: | |
| name: Build Android | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: ${{ needs.changes.outputs.library == 'true' || needs.changes.outputs.deps == 'true' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'yarn' | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| example/showcase/android/.gradle | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/gradle.properties') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }}- | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Build library | |
| run: yarn prepare | |
| - name: Install example dependencies | |
| working-directory: example/showcase | |
| run: yarn install --immutable | |
| - name: Run ktlint checks | |
| working-directory: example/showcase/android | |
| run: ./gradlew :react-native-nitro-device-info:ktlintCheck --no-daemon | |
| - name: Build Android app | |
| working-directory: example/showcase/android | |
| run: ./gradlew :app:assembleDebug --no-daemon | |
| validate-package: | |
| name: Validate NPM Package | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: ${{ needs.changes.outputs.library == 'true' || needs.changes.outputs.deps == 'true' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Build library | |
| run: yarn prepare | |
| - name: Pack NPM package | |
| working-directory: packages/react-native-nitro-device-info | |
| run: npm pack | |
| - name: Verify package contents | |
| working-directory: packages/react-native-nitro-device-info | |
| run: | | |
| tar -tzf *.tgz | grep "package/lib/module/index.js" | |
| tar -tzf *.tgz | grep "package/lib/typescript" | |
| tar -tzf *.tgz | grep "package/src/DeviceInfo.nitro.ts" | |
| tar -tzf *.tgz | grep "package/ios/DeviceInfo.swift" | |
| tar -tzf *.tgz | grep "package/android" | |
| # MCP Server CI - only runs when packages/mcp-server changes | |
| mcp-server: | |
| name: MCP Server | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: ${{ needs.changes.outputs.mcp-server == 'true' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Type check MCP server | |
| run: yarn workspace @react-native-nitro-device-info/mcp-server typecheck | |
| - name: Build MCP server | |
| run: yarn workspace @react-native-nitro-device-info/mcp-server build | |
| - name: Run MCP server tests | |
| run: yarn workspace @react-native-nitro-device-info/mcp-server test | |
| - name: Verify build outputs | |
| run: | | |
| test -d packages/mcp-server/dist || exit 1 | |
| test -f packages/mcp-server/dist/index.js || exit 1 |