From cdb6fcb462b3738ebef0843aaf314e2cf29cf919 Mon Sep 17 00:00:00 2001 From: mso7nueh Date: Fri, 8 Aug 2025 11:23:55 +0300 Subject: [PATCH] fix: fastlane --- .gitea/workflows/test-flight-cd.yaml | 3 +++ ios/fastlane/Fastfile | 29 +++++++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/test-flight-cd.yaml b/.gitea/workflows/test-flight-cd.yaml index 8b3a8cf5..ac54d483 100644 --- a/.gitea/workflows/test-flight-cd.yaml +++ b/.gitea/workflows/test-flight-cd.yaml @@ -47,6 +47,9 @@ jobs: echo "${API_APPSTORE_KEY}" | tr -d '\n' | base64 --decode > ios/AuthKey.p8 chmod 600 ios/AuthKey.p8 ls -la ios/AuthKey.p8 + echo "File size: $(wc -c < ios/AuthKey.p8) bytes" + echo "Contents of ios directory:" + ls -la ios/ env: API_APPSTORE_KEY: ${{ vars.API_APPSTORE_KEY }} diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 059e30e1..8304f8bc 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -18,13 +18,28 @@ default_platform(:ios) platform :ios do desc "Push a new beta build to TestFlight" lane :beta do + UI.message "Current working directory: #{Dir.pwd}" UI.message "Checking API key file..." - auth_key_path = "../AuthKey.p8" - if File.exist?(auth_key_path) - UI.message "API key file exists" - else - UI.user_error!("API key file not found at #{auth_key_path}") + possible_paths = [ + "../AuthKey.p8", + "./AuthKey.p8", + "../../AuthKey.p8", + File.expand_path("../AuthKey.p8"), + File.expand_path("./AuthKey.p8") + ] + + auth_key_path = nil + possible_paths.each do |path| + if File.exist?(path) + UI.message "Found AuthKey.p8 at: #{path}" + auth_key_path = path + break + end + end + + if auth_key_path.nil? + UI.user_error!("API key file not found. Tried paths: #{possible_paths.join(', ')}") end match(type: "appstore", readonly: true) @@ -41,14 +56,14 @@ platform :ios do app_store_connect_api_key( key_id: "325JS9JCZH", issuer_id: "dfa27d1d-2bb8-4d4d-847e-0b32f9b880b3", - key_filepath: "../AuthKey.p8", + key_filepath: auth_key_path, duration: 1200, in_house: false ) begin upload_to_testflight( - api_key_path: "../AuthKey.p8", + api_key_path: auth_key_path, skip_waiting_for_build_processing: true, skip_submission: true, distribute_external: false,