Skip to content

Stack update (latest RN Fabric support, TypeScript migration, example rebooted, CI tested) #27

Stack update (latest RN Fabric support, TypeScript migration, example rebooted, CI tested)

Stack update (latest RN Fabric support, TypeScript migration, example rebooted, CI tested) #27

Workflow file for this run

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 react-native-windows@0.74.47
- 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 install --legacy-peer-deps # Need --legacy-peer-deps for react-native-windows@0.74.47
- 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 install --legacy-peer-deps # Need --legacy-peer-deps for react-native-windows@0.74.47
- 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 16,OS=18.4' \
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 react-native-windows@0.74.47 vs @types/react@19
- name: Build library
run: npm run build
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet
uses: nuget/setup-nuget@v2
with:
nuget-version: 'latest'
- name: Verify react-native-windows installation
run: |
Write-Host "🔍 Checking react-native-windows structure..."
if (Test-Path "node_modules\react-native-windows") {
Write-Host "✅ react-native-windows found"
dir "node_modules\react-native-windows\" -Name | Select-Object -First 20
if (Test-Path "node_modules\react-native-windows\PropertySheets") {
Write-Host "✅ PropertySheets found"
dir "node_modules\react-native-windows\PropertySheets\" -Name
if (Test-Path "node_modules\react-native-windows\PropertySheets\External") {
Write-Host "✅ PropertySheets\External found"
dir "node_modules\react-native-windows\PropertySheets\External\" -Name
} else {
Write-Host "❌ PropertySheets\External missing - checking alternative locations..."
# Check if PropertySheets structure changed in newer versions
if (Test-Path "node_modules\react-native-windows\Microsoft.ReactNative.Uwp.CSharpLib.props") {
Write-Host "✅ Found props file in root directory"
} else {
Write-Host "❌ Props file not found in expected locations"
Write-Host "Available files in react-native-windows:"
dir "node_modules\react-native-windows\" -Recurse -Name "*.props" | Select-Object -First 10
}
}
} else {
Write-Host "❌ PropertySheets missing - checking for alternative structure..."
Write-Host "Available directories in react-native-windows:"
dir "node_modules\react-native-windows\" -Directory -Name | Select-Object -First 10
}
} else {
Write-Host "❌ react-native-windows not found"
exit 1
}
- name: Build Windows project (via solution file)
working-directory: windows
run: |
Write-Host "🔨 Building Windows project..."
# Try building first - if it fails due to missing PropertySheets, MSBuild will give clearer error
try {
msbuild RNViewShot.sln /p:Configuration=Debug /p:Platform="x64" /verbosity:normal /p:RestorePackagesPath="../node_modules" /p:ReactNativeWindowsDir="../node_modules/react-native-windows/"
Write-Host "✅ Build succeeded"
}
catch {
Write-Host "❌ Build failed: $($_.Exception.Message)"
Write-Host "Trying alternative build configuration..."
# Try with nuget restore first
nuget restore RNViewShot.sln
msbuild RNViewShot.sln /p:Configuration=Debug /p:Platform="x64" /verbosity:detailed /p:ReactNativeWindowsDir="../node_modules/react-native-windows/"
}