chore: RN Upgrade #78
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: Build Android | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/build-android.yml' | |
| - 'android/**' | |
| - 'example/android/**' | |
| - 'yarn.lock' | |
| - 'example/yarn.lock' | |
| pull_request: | |
| paths: | |
| - '.github/workflows/build-android.yml' | |
| - 'android/**' | |
| - 'example/android/**' | |
| - 'yarn.lock' | |
| - 'example/yarn.lock' | |
| jobs: | |
| build_example: | |
| name: Build Android Example App with new arch enabled | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup JDK 17 | |
| uses: actions/setup-java@v2 | |
| with: | |
| java-version: 17 | |
| distribution: 'temurin' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| - name: Enable Corepack | |
| run: corepack enable | |
| - name: Get yarn cache directory path | |
| id: yarn-cache-dir-path | |
| run: | | |
| if command -v yarn &> /dev/null; then | |
| CACHE_DIR=$(yarn config get cacheFolder 2>/dev/null || yarn cache dir 2>/dev/null || echo "") | |
| if [ -z "$CACHE_DIR" ]; then | |
| CACHE_DIR="$HOME/.yarn/cache" | |
| fi | |
| else | |
| CACHE_DIR="$HOME/.yarn/cache" | |
| fi | |
| echo "dir=$CACHE_DIR" >> $GITHUB_OUTPUT | |
| - name: Restore node_modules from cache | |
| uses: actions/cache@v5 | |
| id: yarn-cache | |
| with: | |
| path: | | |
| ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
| node_modules | |
| example/node_modules | |
| key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-yarn- | |
| - name: Install node_modules | |
| run: yarn install --frozen-lockfile | |
| - name: Install node_modules for example/ | |
| run: yarn install --frozen-lockfile | |
| - name: Restore Gradle cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Run Gradle Build for example/android/ | |
| run: cd example/android && ./gradlew assembleDebug --build-cache && cd ../.. |