diff --git a/.github/workflows/mobile_eas_build.yaml b/.github/workflows/mobile_eas_build.yaml new file mode 100644 index 00000000..61f97e08 --- /dev/null +++ b/.github/workflows/mobile_eas_build.yaml @@ -0,0 +1,69 @@ +name: Mobile EAS Build +on: + pull_request: + types: [labeled] + +permissions: + contents: read + pull-requests: write + +jobs: + build: + if: ${{ github.event.label.name == 'eas build' }} + runs-on: macOS-latest + steps: + - name: 🏗 Setup repo + uses: actions/checkout@v4 + + - name: 🏗 Setup Node + uses: actions/setup-node@v4 + with: + node-version: 22.x + cache: npm + + - name: 🏗 Setup EAS + uses: expo/expo-github-action@v8 + with: + eas-version: latest + token: ${{ secrets.EXPO_TOKEN }} + + - name: Use corepack + run: corepack enable + + - name: 📦 Install dependencies + run: yarn && yarn build + + - name: 🚀 Build app + run: eas build --non-interactive --platform=all --profile production + working-directory: examples/mobile-client/fishjam-chat + + - name: 🛫 Submit iOS app to TestFlight + run: eas submit --non-interactive --platform=ios --latest + working-directory: examples/mobile-client/fishjam-chat + + - name: ⛓️‍💥 Get iOS archive url and version + id: ios_build + run: eas build:list --json --non-interactive | jq -r '[.[] | select(.platform=="IOS")][0] | "version=\(.appVersion) (\(.appBuildVersion))"' >> $GITHUB_OUTPUT + working-directory: examples/mobile-client/fishjam-chat + + - name: ⛓️‍💥 Get Android archive url and version + id: android_build + run: eas build:list --json --non-interactive | jq -r '[.[] | select(.platform=="ANDROID")][0] | "url=\(.artifacts.applicationArchiveUrl)\nversion=\(.appVersion) (\(.appBuildVersion))"' >> $GITHUB_OUTPUT + working-directory: examples/mobile-client/fishjam-chat + + - name: 📱 Get App Store Connect app ID + id: asc_app + run: echo "id=$(jq -r '.submit.production.ios.ascAppId' eas.json)" >> $GITHUB_OUTPUT + working-directory: examples/mobile-client/fishjam-chat + + - name: 💬 Add comment with build links + uses: actions/github-script@v7 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '**Download links**\nAndroid - ${{ steps.android_build.outputs.version }}: ${{ steps.android_build.outputs.url }}\niOS - ${{ steps.ios_build.outputs.version }}: https://testflight.apple.com/v1/app/${{ steps.asc_app.outputs.id }}' + }) diff --git a/examples/mobile-client/fishjam-chat/app.json b/examples/mobile-client/fishjam-chat/app.json index 30adc1c8..c8c0b217 100644 --- a/examples/mobile-client/fishjam-chat/app.json +++ b/examples/mobile-client/fishjam-chat/app.json @@ -10,10 +10,11 @@ "newArchEnabled": true, "ios": { "supportsTablet": true, - "bundleIdentifier": "com.anonymous.fishjamchat", + "bundleIdentifier": "io.fishjam.example.fishjamchat", "infoPlist": { "NSCameraUsageDescription": "Allow $(PRODUCT_NAME) to access your camera.", - "NSMicrophoneUsageDescription": "Allow $(PRODUCT_NAME) to access your microphone." + "NSMicrophoneUsageDescription": "Allow $(PRODUCT_NAME) to access your microphone.", + "ITSAppUsesNonExemptEncryption": false }, "appleTeamId": "J5FM626PE2" }, @@ -37,7 +38,7 @@ "android.permission.FOREGROUND_SERVICE_MICROPHONE", "android.permission.POST_NOTIFICATIONS" ], - "package": "com.anonymous.fishjamchat" + "package": "io.fishjam.example.fishjamchat" }, "web": { "output": "static", @@ -75,6 +76,29 @@ ], "experiments": { "typedRoutes": true - } + }, + "extra": { + "eas": { + "projectId": "3cb3251a-603a-4c13-ab69-6fac3249072d", + "build": { + "experimental": { + "ios": { + "appExtensions": [ + { + "targetName": "ScreenBroadcastExtension", + "bundleIdentifier": "io.fishjam.example.fishjamchat.ScreenBroadcastExtension", + "entitlements": { + "com.apple.security.application-groups": [ + "group.io.fishjam.example.fishjamchat" + ] + } + } + ] + } + } + } + } + }, + "owner": "fishjam-cloud" } } diff --git a/examples/mobile-client/fishjam-chat/eas.json b/examples/mobile-client/fishjam-chat/eas.json new file mode 100644 index 00000000..e4de6387 --- /dev/null +++ b/examples/mobile-client/fishjam-chat/eas.json @@ -0,0 +1,36 @@ +{ + "cli": { + "version": ">= 12.5.3", + "appVersionSource": "remote" + }, + "build": { + "base": { + "ios": { + "image": "latest" + } + }, + "development": { + "extends": "base", + "developmentClient": true, + "distribution": "internal" + }, + "preview": { + "extends": "base", + "distribution": "internal" + }, + "production": { + "extends": "base", + "autoIncrement": true, + "android": { + "buildType": "apk" + } + } + }, + "submit": { + "production": { + "ios": { + "ascAppId": "6711353226" + } + } + } +} diff --git a/examples/mobile-client/fishjam-chat/package.json b/examples/mobile-client/fishjam-chat/package.json index 18d6057a..6c0daccb 100644 --- a/examples/mobile-client/fishjam-chat/package.json +++ b/examples/mobile-client/fishjam-chat/package.json @@ -8,7 +8,9 @@ "android": "expo run:android", "ios": "expo run:ios", "web": "expo start --web", - "lint": "expo lint" + "lint": "expo lint", + "eas-build-pre-install": "corepack enable && yarn && (cd ../../.. && yarn build)", + "prebuild": "rm -rf android/app/build && expo prebuild" }, "dependencies": { "@expo/vector-icons": "^15.0.3",