feat: cli and repo rework #243
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] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build-lint: | |
| name: Build & static code analysis | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Build packages | |
| run: yarn build | |
| - name: Lint files | |
| run: yarn lint | |
| - name: Typecheck files | |
| run: yarn typecheck | |
| - name: Test Brownfield CLI | |
| run: | | |
| yarn workspace @callstack/react-native-brownfield brownfield --version | |
| tester-android: | |
| name: Integrated tester Android App | |
| runs-on: ubuntu-latest | |
| needs: build-lint | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Build packages | |
| run: yarn build | |
| - name: Build integrated Android tester app | |
| run: | | |
| cd apps/tester-integrated/kotlin | |
| ./gradlew assembleDebug | |
| tester-ios: | |
| name: Integrated tester iOS App | |
| runs-on: macos-latest | |
| needs: build-lint | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Use appropriate Xcode version | |
| uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 | |
| with: | |
| xcode-version: '16' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'yarn' | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Build packages | |
| run: yarn build | |
| - name: Install pods | |
| run: | | |
| cd apps/tester-integrated/swift | |
| pod install | |
| - name: Build integrated iOS tester app | |
| run: | | |
| cd apps/tester-integrated/swift | |
| xcodebuild -workspace SwiftExample.xcworkspace -scheme SwiftExample -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16' build CODE_SIGNING_ALLOWED=NO | |
| packaging-android: | |
| name: Android integration workflow with CLI | |
| runs-on: ubuntu-latest | |
| needs: tester-android | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'yarn' | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Build packages | |
| run: yarn build | |
| - name: Package AAR with the Brownfield CLI | |
| run: | | |
| cd apps/RNApp | |
| node ../../packages/react-native-brownfield/lib/commonjs/index.js package:android --module-name :BrownfieldLib --variant release | |
| - name: Publish AAR artifact to Maven Local | |
| run: | | |
| cd apps/RNApp/android/BrownfieldLib | |
| node ../../packages/react-native-brownfield/lib/commonjs/index.js publish:android --module-name :BrownfieldLib | |
| - name: Verify debug AAR exists in Maven Local | |
| run: stat ~/.m2/repository/com/rnapp/brownfieldlib/0.0.1-local/brownfieldlib-0.0.1-local-debug.aar | |
| - name: Verify release AAR exists in Maven Local | |
| run: stat ~/.m2/repository/com/rnapp/brownfieldlib/0.0.1-local/brownfieldlib-0.0.1-local-release.aar | |
| - name: Build native Android Brownfield app | |
| run: | | |
| cd apps/AndroidApp | |
| ./gradlew assembleDebug | |
| packaging-ios: | |
| name: iOS integration workflow with CLI | |
| runs-on: macos-latest | |
| needs: tester-ios | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Use appropriate Xcode version | |
| uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0 | |
| with: | |
| xcode-version: '16' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 'lts/*' | |
| cache: 'yarn' | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Build packages | |
| run: yarn build | |
| - name: Install pods | |
| run: | | |
| cd apps/RNApp/ios | |
| pod install | |
| - name: Package iOS Framework with the Brownfield CLI | |
| run: | | |
| cd apps/RNApp | |
| node ../../packages/react-native-brownfield/lib/commonjs/index.js package:ios --workspace RNApp --scheme BrownfieldLib --configuration Release | |
| - name: Build Brownfield iOS native app | |
| run: | | |
| cd apps/iOSApp | |
| xcodebuild -workspace iOSApp.xcworkspace -scheme iOSApp -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16' build CODE_SIGNING_ALLOWED=NO |