refactor: try to use method actions instead of classes
This commit is contained in:
parent
296d7181ca
commit
fa9de2881f
@ -26,7 +26,7 @@ module Fastlane
|
|||||||
UI.message("👉🏼 New keychain created")
|
UI.message("👉🏼 New keychain created")
|
||||||
|
|
||||||
# Obtain App Store Connect API key
|
# Obtain App Store Connect API key
|
||||||
api_key = Actions::AppStoreConnectApiKeyAction.run(
|
api_key = Actions.app_store_connect_api_key.call(
|
||||||
key_id: creds['apple_key_id'].to_s,
|
key_id: creds['apple_key_id'].to_s,
|
||||||
issuer_id: creds['apple_issuer_id'].to_s,
|
issuer_id: creds['apple_issuer_id'].to_s,
|
||||||
key_content: creds['apple_key_content'].to_s,
|
key_content: creds['apple_key_content'].to_s,
|
||||||
@ -36,7 +36,7 @@ module Fastlane
|
|||||||
UI.message("👉🏼 API Key formated")
|
UI.message("👉🏼 API Key formated")
|
||||||
|
|
||||||
last_testflight_build_number =
|
last_testflight_build_number =
|
||||||
Actions::LatestTestflightBuildNumberAction.run(
|
Actions.latest_testflight_build_number(
|
||||||
api_key: api_key,
|
api_key: api_key,
|
||||||
team_id: "118579280",
|
team_id: "118579280",
|
||||||
team_name: "Jagger & Lewis",
|
team_name: "Jagger & Lewis",
|
||||||
@ -46,14 +46,14 @@ module Fastlane
|
|||||||
) + 1
|
) + 1
|
||||||
|
|
||||||
# Increment build number for latest TestFlight build
|
# Increment build number for latest TestFlight build
|
||||||
Actions::IncrementBuildNumberAction.run(
|
Actions.increment_build_number(
|
||||||
build_number: last_testflight_build_number + 1,
|
build_number: last_testflight_build_number + 1,
|
||||||
xcodeproj: "Runner.xcodeproj"
|
xcodeproj: "Runner.xcodeproj"
|
||||||
)
|
)
|
||||||
UI.message("👉🏼 Build number incremented")
|
UI.message("👉🏼 Build number incremented")
|
||||||
|
|
||||||
# Install Cocoapods
|
# Install Cocoapods
|
||||||
Actions::CocoapodsAction.run(
|
Actions.cocoapods(
|
||||||
clean_install: true,
|
clean_install: true,
|
||||||
clean: true,
|
clean: true,
|
||||||
integrate: true,
|
integrate: true,
|
||||||
@ -66,7 +66,7 @@ module Fastlane
|
|||||||
# 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.match(
|
||||||
api_key: api_key,
|
api_key: api_key,
|
||||||
type: 'appstore',
|
type: 'appstore',
|
||||||
app_identifier: creds['app_identifier_extensions'],
|
app_identifier: creds['app_identifier_extensions'],
|
||||||
@ -84,7 +84,7 @@ module Fastlane
|
|||||||
|
|
||||||
# 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.gym(
|
||||||
configuration: "Release",
|
configuration: "Release",
|
||||||
workspace: "Runner.xcworkspace",
|
workspace: "Runner.xcworkspace",
|
||||||
scheme: "your_schema",
|
scheme: "your_schema",
|
||||||
@ -96,7 +96,7 @@ module Fastlane
|
|||||||
UI.message("👉🏼 App built")
|
UI.message("👉🏼 App built")
|
||||||
|
|
||||||
# Upload build to App Store Connect using Pilot
|
# Upload build to App Store Connect using Pilot
|
||||||
Actions::PilotAction.run(
|
Actions.pilot(
|
||||||
api_key: api_key,
|
api_key: api_key,
|
||||||
username: "leonmalo@sfr.fr",
|
username: "leonmalo@sfr.fr",
|
||||||
team_id: "118579280",
|
team_id: "118579280",
|
||||||
@ -111,7 +111,7 @@ module Fastlane
|
|||||||
)
|
)
|
||||||
UI.message("👉🏼 App uploaded")
|
UI.message("👉🏼 App uploaded")
|
||||||
|
|
||||||
Actions::DeleteTempKeychainAction.run
|
Actions.deleteTemp_keychain
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.description
|
def self.description
|
||||||
|
@ -8,7 +8,7 @@ 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.delete_keychain(
|
||||||
name: name
|
name: name
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
@ -16,7 +16,7 @@ module Fastlane
|
|||||||
|
|
||||||
# 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(
|
Actionz.create_keychain(
|
||||||
name: name,
|
name: name,
|
||||||
password: password,
|
password: password,
|
||||||
unlock: false,
|
unlock: false,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user