fix: update syntax (#2)

This commit is contained in:
Malo Léon 2023-04-27 16:52:22 +02:00
parent 1759498e23
commit cc2cd8ea68
3 changed files with 25 additions and 23 deletions

View File

@ -8,7 +8,7 @@
], ],
"apple_issuer_id":"69a6de90-9fe1-47e3-e053-5b8c7c11a4d1", "apple_issuer_id":"69a6de90-9fe1-47e3-e053-5b8c7c11a4d1",
"apple_key_id":"VBRDBQM7SJ", "apple_key_id":"VBRDBQM7SJ",
"apple_key_content":"-----BEGIN PRIVATE KEY-----MIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgxLuVvuI7DafrGHTzATTtdB1TgIFkb12qFVyNSj4kuE+gCgYIKoZIzj0DAQehRANCAAQl7PyxfJR2QoKCmpqvjG4mQxMIzehm9TsLAjwLrPya4LWRyxrEEvPG/N5L06udHtv26gLDMR5gY6uOY1pVJX28-----END PRIVATE KEY-----", "apple_key_content":"-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgxLuVvuI7DafrGHTz\nATTtdB1TgIFkb12qFVyNSj4kuE+gCgYIKoZIzj0DAQehRANCAAQl7PyxfJR2QoKC\nmpqvjG4mQxMIzehm9TsLAjwLrPya4LWRyxrEEvPG/N5L06udHtv26gLDMR5gY6uO\nY1pVJX28\n-----END PRIVATE KEY-----",
"provisioning_profiles":{ "provisioning_profiles":{
"1624036332": "match AppStore com.jaggerlewis.jl3", "1624036332": "match AppStore com.jaggerlewis.jl3",
"com.jaggerlewis.jl3.OneSignalNotificationServiceExtension": "match AppStore com.jaggerlewis.jl3.OneSignalNotificationServiceExtension" "com.jaggerlewis.jl3.OneSignalNotificationServiceExtension": "match AppStore com.jaggerlewis.jl3.OneSignalNotificationServiceExtension"

View File

@ -19,48 +19,50 @@ module Fastlane
# Retrieve credentials # Retrieve credentials
creds = Helper::IosCdHelper.parseIosCredentials('.') creds = Helper::IosCdHelper.parseIosCredentials('.')
UI.message(creds.to_s)
# Ensure temporary keychain exists # Ensure temporary keychain exists
Helper::IosCdHelper.ensure_temp_keychain(creds['temp_keychain_user'], creds['temp_keychain_password']) Helper::IosCdHelper.ensure_temp_keychain(creds['temp_keychain_user'], creds['temp_keychain_password'])
# Obtain App Store Connect API key # Obtain App Store Connect API key
api_key = Actions::AppStoreConnectApiKeyAction.run({ api_key = Actions::AppStoreConnectApiKeyAction.run(
key_id: creds['apple_key_id'], key_id: creds['apple_key_id'].to_s,
issuer_id: creds['apple_issuer_id'], issuer_id: creds['apple_issuer_id'].to_s,
key_content: creds['apple_key_content'], key_content: creds['apple_key_content'].to_s,
duration: 1200, duration: 1200,
in_house: false in_house: false
}) )
# Increment build number for latest TestFlight build # Increment build number for latest TestFlight build
Actions::IncrementBuildNumberAction.run({ Actions::IncrementBuildNumberAction.run(
build_number: Actions::LatestTestflightBuildNumberAction.run({}) + 1, build_number: Actions::LatestTestflightBuildNumberAction.run(
api_key: api_key,
team_id: "118579280",
team_name: "Jagger & Lewis"
) + 1,
xcodeproj: "Runner.xcodeproj" xcodeproj: "Runner.xcodeproj"
}) )
# Install Cocoapods # Install Cocoapods
Actions::CocoapodsAction.run({ Actions::CocoapodsAction.run(
clean_install: true clean_install: true
}) )
# Set up code signing using match # Set up code signing using match
# Configures and runs `match` which manages code signing certificates and provisioning profiles for the project. # Configures and runs `match` which manages code signing certificates and provisioning profiles for the project.
# The function takes the app's bundle identifier, an authorization token for the project's Git repository, and the name and password for a temporary keychain used to store the signing certificate. # The function takes the app's bundle identifier, an authorization token for the project's Git repository, and the name and password for a temporary keychain used to store the signing certificate.
# It uses the App Store Connect API key to access the App Store and increment the build number. # It uses the App Store Connect API key to access the App Store and increment the build number.
# It then runs `gym` to build and sign the app using the selected provisioning profile, and finally, uses `pilot` to upload the app to TestFlight for beta testing. # It then runs `gym` to build and sign the app using the selected provisioning profile, and finally, uses `pilot` to upload the app to TestFlight for beta testing.
Actions::MatchAction.run({ Actions::MatchAction.run(
type: 'appstore', type: 'appstore',
app_identifier: creds['app_identifier_extensions'], app_identifier: creds['app_identifier_extensions'],
git_basic_authorization: Base64.strict_encode64(ENV["GIT_AUTHORIZATION"]), git_basic_authorization: Base64.strict_encode64(ENV["GIT_AUTHORIZATION"]),
keychain_name: creds['temp_keychain_user'], keychain_name: creds['temp_keychain_user'],
keychain_password: creds['temp_keychain_password'], keychain_password: creds['temp_keychain_password'],
api_key: api_key api_key: api_key
}) )
# Build and export app using Gym # Build and export app using Gym
# Builds and packages an iOS app or framework for distribution to the App Store, TestFlight, or Enterprise distribution. # Builds and packages an iOS app or framework for distribution to the App Store, TestFlight, or Enterprise distribution.
Actions::GymAction.run({ Actions::GymAction.run(
configuration: "Release", configuration: "Release",
workspace: "Runner.xcworkspace", workspace: "Runner.xcworkspace",
scheme: "your_schema", scheme: "your_schema",
@ -68,10 +70,10 @@ module Fastlane
export_options: { export_options: {
provisioningProfiles: creds['provisioning_profiles'] provisioningProfiles: creds['provisioning_profiles']
} }
}) )
# Upload build to App Store Connect using Pilot # Upload build to App Store Connect using Pilot
Actions::PilotAction.run({ Actions::PilotAction.run(
apple_id: creds['developer_app_id'].to_s, apple_id: creds['developer_app_id'].to_s,
app_identifier: creds['developer_app_identifier'].to_s, app_identifier: creds['developer_app_identifier'].to_s,
skip_waiting_for_build_processing: true, skip_waiting_for_build_processing: true,
@ -79,7 +81,7 @@ module Fastlane
distribute_external: false, distribute_external: false,
notify_external_testers: false, notify_external_testers: false,
ipa: "./Runner.ipa" ipa: "./Runner.ipa"
}) )
Actions::DeleteTempKeychainAction.run Actions::DeleteTempKeychainAction.run
end end

View File

@ -8,20 +8,20 @@ module Fastlane
# Define method to delete temporary keychain # Define method to delete temporary keychain
def self.delete_temp_keychain(name) def self.delete_temp_keychain(name)
if File.exist?(File.expand_path("~/Library/Keychains/#{name}-db")) if File.exist?(File.expand_path("~/Library/Keychains/#{name}-db"))
Actions::DeleteKeychainAction.run({ Actions::DeleteKeychainAction.run(
name: name name: name
}) )
end end
end end
# Define method to create temporary keychain # Define method to create temporary keychain
def self.create_temp_keychain(name, password) def self.create_temp_keychain(name, password)
Actions::CreateKeychainAction.run({ Actions::CreateKeychainAction.run(
name: name, name: name,
password: password, password: password,
unlock: false, unlock: false,
timeout: 0 timeout: 0
}) )
end end
# Define method to ensure that temporary keychain exists # Define method to ensure that temporary keychain exists