Stack update (latest RN Fabric support, TypeScript migration, example rebooted, CI tested) #19
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, master] | |
| pull_request: | |
| branches: [main, master] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint-and-type-check: | |
| name: Code Quality (Strict) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm install --legacy-peer-deps # Need --legacy-peer-deps for [email protected] | |
| - name: Check formatting (no prettier diff allowed) | |
| run: npm run format:check | |
| - name: Run TypeScript type check (strict) | |
| run: npm run type-check | |
| - name: Run linter (strict - no warnings allowed) | |
| run: npm run lint:ci | |
| - name: Build project | |
| run: npm run build | |
| build-android: | |
| name: Build Android APK | |
| runs-on: ubuntu-latest | |
| needs: lint-and-type-check | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Setup Java JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Cache Gradle | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build library | |
| run: npm run build | |
| - name: Install example dependencies | |
| working-directory: example | |
| run: npm ci | |
| - name: Build Android APK | |
| working-directory: example/android | |
| run: ./gradlew assembleDebug --no-daemon | |
| - name: Upload Android APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-apk | |
| path: example/android/app/build/outputs/apk/debug/app-debug.apk | |
| build-ios: | |
| name: Build iOS App | |
| runs-on: macos-15 # Use latest macOS with Xcode 16.1+ | |
| needs: lint-and-type-check | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Cache CocoaPods | |
| uses: actions/cache@v4 | |
| with: | |
| path: example/ios/Pods | |
| key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pods- | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build library | |
| run: npm run build | |
| - name: Install example dependencies | |
| working-directory: example | |
| run: npm ci | |
| - name: Setup CocoaPods | |
| uses: maxim-lobanov/setup-cocoapods@v1 | |
| with: | |
| version: latest | |
| - name: Pod install | |
| working-directory: example/ios | |
| run: pod install --verbose | |
| - name: Build iOS | |
| working-directory: example | |
| run: | | |
| xcodebuild -workspace ios/ViewShotExample.xcworkspace \ | |
| -scheme ViewShotExample \ | |
| -configuration Debug \ | |
| -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.0' \ | |
| build CODE_SIGNING_ALLOWED=NO | |
| - name: Upload iOS Build Logs | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ios-build-logs | |
| path: ~/Library/Logs/DiagnosticReports/ | |
| build-windows: | |
| name: Build Windows | |
| runs-on: windows-latest | |
| needs: lint-and-type-check | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm install --legacy-peer-deps # Need --legacy-peer-deps for [email protected] vs @types/react@19 | |
| - name: Build library | |
| run: npm run build | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Verify react-native-windows installation | |
| run: | | |
| if (Test-Path "node_modules\react-native-windows\PropertySheets") { | |
| Write-Host "✅ PropertySheets found" | |
| dir "node_modules\react-native-windows\PropertySheets\External\" -Name | |
| } else { | |
| Write-Host "❌ PropertySheets missing" | |
| dir "node_modules\react-native-windows\" -Name | |
| exit 1 | |
| } | |
| - name: Build Windows project | |
| working-directory: windows | |
| run: msbuild RNViewShot\RNViewShot.csproj /p:Configuration=Debug /p:Platform="Any CPU" /verbosity:normal | |