FIX: Catalyst build - arm64 only, auth bypass, robust app path detection
This commit is contained in:
parent
0905c28989
commit
8ea9b7aa16
10
.github/workflows/build-mac-catalyst.yml
vendored
10
.github/workflows/build-mac-catalyst.yml
vendored
@ -37,18 +37,24 @@ jobs:
|
||||
bundler-cache: true
|
||||
|
||||
- name: Install Node modules
|
||||
run: npm ci --omit=dev --yes
|
||||
run: npm ci
|
||||
|
||||
- name: Install CocoaPods dependencies
|
||||
run: bundle exec fastlane ios install_pods
|
||||
env:
|
||||
SKIP_APP_STORE_CONNECT_AUTH: '1'
|
||||
|
||||
- name: Build Mac Catalyst app with Fastlane
|
||||
id: build_catalyst
|
||||
run: bundle exec fastlane ios build_catalyst_app_lane
|
||||
env:
|
||||
SKIP_APP_STORE_CONNECT_AUTH: '1'
|
||||
SKIP_CLEAR_DERIVED_DATA: '1'
|
||||
|
||||
- name: Upload Mac Catalyst artifact
|
||||
if: success()
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: bluewallet-mac-catalyst-app
|
||||
path: ${{ steps.build_catalyst.outputs.catalyst_app_path }}
|
||||
if-no-files-found: error
|
||||
if-no-files-found: warn
|
||||
|
||||
@ -82,10 +82,17 @@ def cached_app_store_connect_login
|
||||
end
|
||||
|
||||
before_all do |lane, options|
|
||||
skip_auth_lanes = ['register_devices_from_txt']
|
||||
if ENV['SKIP_APP_STORE_CONNECT_AUTH'] == '1'
|
||||
UI.message('Skipping App Store Connect authentication (SKIP_APP_STORE_CONNECT_AUTH=1)')
|
||||
next
|
||||
end
|
||||
|
||||
skip_auth_lanes = ['register_devices_from_txt', 'build_catalyst_app_lane', 'install_pods', 'clear_derived_data_lane']
|
||||
lane_name = lane.to_s
|
||||
should_skip_auth = skip_auth_lanes.any? { |skip_lane| lane_name == skip_lane || lane_name.end_with?(" #{skip_lane}") }
|
||||
|
||||
# Check if we need App Store Connect for this lane
|
||||
unless skip_auth_lanes.include?(lane)
|
||||
unless should_skip_auth
|
||||
begin
|
||||
# Try to authenticate once at the beginning
|
||||
require 'spaceship'
|
||||
@ -467,7 +474,11 @@ platform :ios do
|
||||
workspace_path = File.join(project_root, "ios", "BlueWallet.xcworkspace")
|
||||
derived_data_path = File.join(project_root, "ios", "build", "catalyst-derived-data")
|
||||
|
||||
clear_derived_data_lane
|
||||
if ENV['SKIP_CLEAR_DERIVED_DATA'] == '1'
|
||||
UI.message('Skipping clear_derived_data_lane (SKIP_CLEAR_DERIVED_DATA=1)')
|
||||
else
|
||||
clear_derived_data_lane
|
||||
end
|
||||
FileUtils.mkdir_p(derived_data_path)
|
||||
|
||||
build_app(
|
||||
@ -475,6 +486,7 @@ platform :ios do
|
||||
workspace: workspace_path,
|
||||
configuration: "Release",
|
||||
destination: "generic/platform=macOS,variant=Mac Catalyst",
|
||||
xcargs: "ARCHS=arm64 ONLY_ACTIVE_ARCH=YES",
|
||||
clean: true,
|
||||
skip_codesigning: true,
|
||||
skip_package_ipa: true,
|
||||
@ -482,7 +494,17 @@ platform :ios do
|
||||
buildlog_path: File.join(project_root, "ios", "build_logs")
|
||||
)
|
||||
|
||||
catalyst_app_path = Dir.glob(File.join(derived_data_path, "Build/Products/Release-maccatalyst/*.app")).first
|
||||
archive_path = lane_context[SharedValues::XCODEBUILD_ARCHIVE]
|
||||
if archive_path.nil? || archive_path.empty?
|
||||
archive_path = Dir.glob(File.join(Dir.home, "Library/Developer/Xcode/Archives/**/*.xcarchive")).max_by { |path| File.mtime(path) }
|
||||
end
|
||||
|
||||
candidate_paths = []
|
||||
candidate_paths << File.join(archive_path, "Products/Applications/BlueWallet.app") if archive_path
|
||||
candidate_paths << Dir.glob(File.join(derived_data_path, "Build/Products/Release-maccatalyst/*.app")).first
|
||||
candidate_paths << Dir.glob(File.join(derived_data_path, "Build/Intermediates.noindex/ArchiveIntermediates/BlueWallet/BuildProductsPath/Release-maccatalyst/*.app")).first
|
||||
|
||||
catalyst_app_path = candidate_paths.compact.find { |path| File.exist?(path) }
|
||||
UI.user_error!("Mac Catalyst app was not found after build") if catalyst_app_path.nil?
|
||||
|
||||
ENV['CATALYST_APP_PATH'] = catalyst_app_path
|
||||
|
||||
Loading…
Reference in New Issue
Block a user