|
14 | 14 | outputs: |
15 | 15 | android_apps: ${{ steps.matrix.outputs.android_apps }} |
16 | 16 | ios_apps: ${{ steps.matrix.outputs.ios_apps }} |
| 17 | + bundle_apps: ${{ steps.matrix.outputs.bundle_apps }} |
17 | 18 | steps: |
18 | 19 | - name: Checkout |
19 | 20 | uses: actions/checkout@v6 |
@@ -122,12 +123,47 @@ jobs: |
122 | 123 | if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then |
123 | 124 | echo "android_apps=$all" >> "$GITHUB_OUTPUT" |
124 | 125 | echo "ios_apps=$all" >> "$GITHUB_OUTPUT" |
| 126 | + echo "bundle_apps=$all" >> "$GITHUB_OUTPUT" |
125 | 127 | else |
126 | 128 | changes='${{ steps.filter.outputs.changes }}' |
127 | 129 | android_apps=$(echo "$changes" | jq -c '[.[] | select(endswith("-android")) | sub("-android$"; "")]') |
128 | 130 | ios_apps=$(echo "$changes" | jq -c '[.[] | select(endswith("-ios")) | sub("-ios$"; "")]') |
| 131 | + bundle_apps=$(echo "$changes" | jq -c '[.[] | select(endswith("-app")) | sub("-app$"; "")]') |
129 | 132 | echo "android_apps=$android_apps" >> "$GITHUB_OUTPUT" |
130 | 133 | echo "ios_apps=$ios_apps" >> "$GITHUB_OUTPUT" |
| 134 | + echo "bundle_apps=$bundle_apps" >> "$GITHUB_OUTPUT" |
| 135 | + fi |
| 136 | +
|
| 137 | + bundle: |
| 138 | + needs: detect-changes |
| 139 | + if: needs.detect-changes.outputs.bundle_apps != '[]' && needs.detect-changes.outputs.bundle_apps != '' |
| 140 | + runs-on: ubuntu-latest |
| 141 | + strategy: |
| 142 | + fail-fast: false |
| 143 | + matrix: |
| 144 | + app: ${{ fromJSON(needs.detect-changes.outputs.bundle_apps) }} |
| 145 | + platform: [android, ios] |
| 146 | + concurrency: |
| 147 | + group: bundle-${{ matrix.platform }}-${{ matrix.app }}-${{ github.ref }} |
| 148 | + cancel-in-progress: true |
| 149 | + steps: |
| 150 | + - name: Checkout |
| 151 | + uses: actions/checkout@v6 |
| 152 | + - name: Setup |
| 153 | + uses: ./.github/actions/setup |
| 154 | + - name: Bundle JS for ${{ matrix.platform }} |
| 155 | + working-directory: apps/${{ matrix.app }} |
| 156 | + run: | |
| 157 | + if [ "${{ matrix.app }}" = "bare-rn" ]; then |
| 158 | + npx react-native bundle \ |
| 159 | + --platform ${{ matrix.platform }} \ |
| 160 | + --entry-file index.js \ |
| 161 | + --bundle-output /tmp/bundle.js \ |
| 162 | + --dev false |
| 163 | + else |
| 164 | + npx expo export \ |
| 165 | + --platform ${{ matrix.platform }} \ |
| 166 | + --output-dir /tmp/expo-export |
131 | 167 | fi |
132 | 168 |
|
133 | 169 | build-android: |
|
0 commit comments