From 44790bb6599f9312073df4e239d714adce9aa7e6 Mon Sep 17 00:00:00 2001 From: millianlmx Date: Sat, 27 Jun 2026 22:11:35 +0000 Subject: [PATCH 1/3] fix(ci): use Release + archive/export for Firebase OTA distribution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Switch from Debug build to Release archive with xcodebuild archive - Use xcodebuild -exportArchive with ad-hoc exportOptions.plist for proper Ad Hoc distribution signing (required for Firebase OTA installs) - Fix CFBundleVersion mismatch in Info.plist (1 → 2) to match project.yml - Create Config/exportOptions.plist with method=ad-hoc and team 2MJF39L8VY Previously Debug builds produced a Development provisioning profile that doesn't include the tester's iPhone UDID, causing 'cannot be installed'. --- .gitea/workflows/pr-iphone-deploy.yml | 20 +++++++++++--------- tabatago-swift/Config/exportOptions.plist | 14 ++++++++++++++ tabatago-swift/TabataGo/Resources/Info.plist | 2 +- 3 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 tabatago-swift/Config/exportOptions.plist diff --git a/.gitea/workflows/pr-iphone-deploy.yml b/.gitea/workflows/pr-iphone-deploy.yml index 761dfec..3e3bd0c 100644 --- a/.gitea/workflows/pr-iphone-deploy.yml +++ b/.gitea/workflows/pr-iphone-deploy.yml @@ -84,14 +84,15 @@ jobs: -project TabataGo.xcodeproj \ -scmProvider system - - name: Build app + - name: Archive app run: | cd tabatago-swift xcodebuild -list - xcodebuild build \ + xcodebuild archive \ -project TabataGo.xcodeproj \ -scheme TabataGo \ - -configuration Debug \ + -configuration Release \ + -archivePath ../build/TabataGo.xcarchive \ -allowProvisioningUpdates \ -skipPackagePluginValidation \ -derivedDataPath ../build/derived \ @@ -101,14 +102,15 @@ jobs: CODE_SIGN_STYLE=Automatic \ DEVELOPMENT_TEAM=2MJF39L8VY - - name: Package IPA + - name: Export IPA (Ad Hoc) run: | cd tabatago-swift - mkdir -p Payload build - APP=$(find ../build/derived -name 'TabataGo.app' -type d | head -1) - cp -R "$APP" Payload/ - zip -r build/TabataGo.ipa Payload/ - rm -rf Payload + mkdir -p build + xcodebuild -exportArchive \ + -archivePath ../build/TabataGo.xcarchive \ + -exportPath build \ + -exportOptionsPlist Config/exportOptions.plist \ + -allowProvisioningUpdates - name: Deploy to Firebase env: diff --git a/tabatago-swift/Config/exportOptions.plist b/tabatago-swift/Config/exportOptions.plist new file mode 100644 index 0000000..9da1850 --- /dev/null +++ b/tabatago-swift/Config/exportOptions.plist @@ -0,0 +1,14 @@ + + + + + method + ad-hoc + teamID + 2MJF39L8VY + compileBitcode + + signingStyle + automatic + + diff --git a/tabatago-swift/TabataGo/Resources/Info.plist b/tabatago-swift/TabataGo/Resources/Info.plist index 9af55fc..36ae005 100644 --- a/tabatago-swift/TabataGo/Resources/Info.plist +++ b/tabatago-swift/TabataGo/Resources/Info.plist @@ -28,7 +28,7 @@ CFBundleVersion - 1 + 2 NSHealthShareUsageDescription TabataGo reads your health data to show fitness stats and personalize your workouts. NSHealthUpdateUsageDescription -- 2.49.1 From 4fa0d891bba8738120759058c27b65e2d5e166fa Mon Sep 17 00:00:00 2001 From: millianlmx Date: Sat, 27 Jun 2026 22:20:18 +0000 Subject: [PATCH 2/3] fix(ci): replace Firebase OTA with USB direct deploy --- .gitea/workflows/pr-iphone-deploy.yml | 47 +++++++---------------- tabatago-swift/Config/exportOptions.plist | 14 ------- 2 files changed, 14 insertions(+), 47 deletions(-) delete mode 100644 tabatago-swift/Config/exportOptions.plist diff --git a/.gitea/workflows/pr-iphone-deploy.yml b/.gitea/workflows/pr-iphone-deploy.yml index 3e3bd0c..7ae783b 100644 --- a/.gitea/workflows/pr-iphone-deploy.yml +++ b/.gitea/workflows/pr-iphone-deploy.yml @@ -1,8 +1,8 @@ # ============================================================================= -# TabataGo — PR → Build → Archive → Firebase OTA → Wait LGTM → Merge +# TabataGo — PR → Build → USB Direct Deploy → Wait LGTM → Merge # ============================================================================= -name: PR → Build → Firebase OTA → LGTM +name: PR → Build → USB Deploy → LGTM on: pull_request: @@ -16,14 +16,14 @@ permissions: jobs: build-deploy: - name: Build & Deploy to Firebase OTA + name: Build & Deploy to iPhone via USB runs-on: macos timeout-minutes: 20 steps: - name: Checkout run: | - git clone --depth 1 -b ${{ github.head_ref }} https://x-access-token:${PR_TOKEN}@gitea.1000co.fr/${REPO}.git . + git clone --depth 1 -b ${{ github.head_ref }} https://x-access-token:${PR_TOKEN}@gitea.1000co.fr/${{ github.repository }}.git . env: PR_TOKEN: ${{ secrets.PR_API_TOKEN }} REPO: ${{ github.repository }} @@ -67,10 +67,9 @@ jobs: echo "✅ Caches nettoyés" - - name: Install tools (xcodegen, node, firebase) + - name: Install tools (xcodegen, node, ios-deploy) run: | - brew install xcodegen node || true - npm install -g firebase-tools + brew install xcodegen node ios-deploy || true - name: Generate Xcode project run: | @@ -84,15 +83,13 @@ jobs: -project TabataGo.xcodeproj \ -scmProvider system - - name: Archive app + - name: Build app run: | cd tabatago-swift - xcodebuild -list - xcodebuild archive \ + xcodebuild build \ -project TabataGo.xcodeproj \ -scheme TabataGo \ - -configuration Release \ - -archivePath ../build/TabataGo.xcarchive \ + -configuration Debug \ -allowProvisioningUpdates \ -skipPackagePluginValidation \ -derivedDataPath ../build/derived \ @@ -102,27 +99,11 @@ jobs: CODE_SIGN_STYLE=Automatic \ DEVELOPMENT_TEAM=2MJF39L8VY - - name: Export IPA (Ad Hoc) + - name: Install to iPhone run: | - cd tabatago-swift - mkdir -p build - xcodebuild -exportArchive \ - -archivePath ../build/TabataGo.xcarchive \ - -exportPath build \ - -exportOptionsPlist Config/exportOptions.plist \ - -allowProvisioningUpdates - - - name: Deploy to Firebase - env: - FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }} - FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} - run: | - npx firebase appdistribution:distribute tabatago-swift/build/TabataGo.ipa \ - --app "${FIREBASE_APP_ID}" \ - --groups "millian-test" \ - --project tabatago-19a80 \ - --token "${FIREBASE_TOKEN}" \ - --release-notes "PR: ${{ github.event.pull_request.title }}" + APP=$(find ../build/derived -name 'TabataGo.app' -type d | head -1) + echo "📱 Installing $APP to iPhone..." + ios-deploy --bundle "$APP" --id 00008120-000925CE3672201E --justlaunch - name: Post "Ready to test" comment env: @@ -134,7 +115,7 @@ jobs: curl -s -X POST \ -H "Authorization: token ${GT_TOKEN}" \ -H "Content-Type: application/json" \ - -d "{\"body\":\"## 📱 Prêt à tester !\\n\\nL\'app est déployée via Firebase.\\n\\n- Teste les changements\\n- Reply **LGTM** pour merger\\n- Reply **KO** pour bloquer\"}" \ + -d "{\"body\":\"## 📱 Prêt à tester !\\n\\nL'app est déployée sur l'iPhone (USB).\\n\\n- Teste les changements\\n- Reply **LGTM** pour merger\\n- Reply **KO** pour bloquer\"}" \ "${GITEA_URL}/api/v1/repos/${REPO}/issues/${PR}/comments" wait-approval: diff --git a/tabatago-swift/Config/exportOptions.plist b/tabatago-swift/Config/exportOptions.plist deleted file mode 100644 index 9da1850..0000000 --- a/tabatago-swift/Config/exportOptions.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - method - ad-hoc - teamID - 2MJF39L8VY - compileBitcode - - signingStyle - automatic - - -- 2.49.1 From e8fb70abd891bbaeee3f9953d82503541de334ae Mon Sep 17 00:00:00 2001 From: millianlmx Date: Sat, 27 Jun 2026 22:21:58 +0000 Subject: [PATCH 3/3] fix(ci): add WiFi network install as fallback --- .gitea/workflows/pr-iphone-deploy.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/pr-iphone-deploy.yml b/.gitea/workflows/pr-iphone-deploy.yml index 7ae783b..1678cf9 100644 --- a/.gitea/workflows/pr-iphone-deploy.yml +++ b/.gitea/workflows/pr-iphone-deploy.yml @@ -99,11 +99,29 @@ jobs: CODE_SIGN_STYLE=Automatic \ DEVELOPMENT_TEAM=2MJF39L8VY - - name: Install to iPhone + - name: Install to iPhone (WiFi → USB fallback) run: | + UDID="00008120-000925CE3672201E" APP=$(find ../build/derived -name 'TabataGo.app' -type d | head -1) - echo "📱 Installing $APP to iPhone..." - ios-deploy --bundle "$APP" --id 00008120-000925CE3672201E --justlaunch + + # 1. Try WiFi first (Xcode 15+ devicectl network discovery) + echo "📱 Trying WiFi install via devicectl..." + xcrun devicectl device install app --device "$UDID" "$APP" 2>&1 | tail -3 + if [ ${PIPESTATUS[0]} -eq 0 ]; then + echo "✅ Installed via WiFi" + exit 0 + fi + + # 2. Fallback to USB via ios-deploy + echo "🔌 WiFi failed, trying USB..." + ios-deploy --bundle "$APP" --id "$UDID" --justlaunch + if [ $? -eq 0 ]; then + echo "✅ Installed via USB" + exit 0 + fi + + echo "❌ Install failed (both WiFi and USB)" + exit 1 - name: Post "Ready to test" comment env: -- 2.49.1