|
| 1 | +name: 🤖 Build Android Fabric |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + paths: |
| 8 | + - ".github/workflows/build-android-fabric-windows.yml" |
| 9 | + - "android/**" |
| 10 | + - "yarn.lock" |
| 11 | + - "src/specs/**" |
| 12 | + - "common/**" |
| 13 | + pull_request: |
| 14 | + paths: |
| 15 | + - ".github/workflows/build-android-fabric-windows.yml" |
| 16 | + - "android/**" |
| 17 | + - "yarn.lock" |
| 18 | + - "src/specs/**" |
| 19 | + - "common/**" |
| 20 | + |
| 21 | +jobs: |
| 22 | + build: |
| 23 | + name: 💠 Build Android on Windows |
| 24 | + runs-on: windows-latest |
| 25 | + |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v4 |
| 28 | + - name: Setup JDK 17 |
| 29 | + uses: actions/setup-java@v4 |
| 30 | + with: |
| 31 | + distribution: "microsoft" |
| 32 | + java-version: "17" |
| 33 | + - name: Create sample app |
| 34 | + run: cd ..\..\ && npx @react-native-community/cli@latest init WindowsWithUnbelievablyHugeAndReallyLongPathName --version 0.83.1 |
| 35 | + - name: Get yarn cache directory path |
| 36 | + id: fabric-windows-yarn-cache-dir-path |
| 37 | + shell: pwsh |
| 38 | + run: | |
| 39 | + $dir = yarn cache dir |
| 40 | + echo "dir=$dir" >> $env:GITHUB_OUTPUT |
| 41 | + - name: Restore node_modules from cache |
| 42 | + uses: actions/cache@v4 |
| 43 | + id: yarn-cache |
| 44 | + with: |
| 45 | + path: ${{ steps.fabric-windows-yarn-cache-dir-path.outputs.dir }} |
| 46 | + key: ${{ runner.os }}-fabric-windows-yarn-${{ hashFiles('**/yarn.lock') }} |
| 47 | + restore-keys: | |
| 48 | + ${{ runner.os }}-fabric-windows-yarn- |
| 49 | + - name: Install node_modules for windows/ |
| 50 | + shell: pwsh |
| 51 | + run: | |
| 52 | + cd ..\..\ && yarn install --frozen-lockfile --cwd WindowsWithUnbelievablyHugeAndReallyLongPathName |
| 53 | + - name: Link keyboard controller |
| 54 | + shell: pwsh |
| 55 | + run: cd ..\..\WindowsWithUnbelievablyHugeAndReallyLongPathName && yarn add react-native-keyboard-controller@link:../react-native-keyboard-controller/react-native-keyboard-controller |
| 56 | + - name: Restore Gradle cache |
| 57 | + uses: actions/cache@v4 |
| 58 | + with: |
| 59 | + path: | |
| 60 | + C:\Users\runneradmin\.gradle\caches |
| 61 | + C:\Users\runneradmin\.gradle\wrapper |
| 62 | + key: ${{ runner.os }}-fabric-windows-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} |
| 63 | + restore-keys: | |
| 64 | + ${{ runner.os }}-fabric-windows-gradle- |
| 65 | + - name: Run Gradle Build for windows/android/ |
| 66 | + shell: pwsh |
| 67 | + run: | |
| 68 | + cd ..\..\WindowsWithUnbelievablyHugeAndReallyLongPathName\android |
| 69 | + .\gradlew.bat assembleDebug --build-cache -PreactNativeArchitectures=arm64-v8a |
0 commit comments