repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/update_project_team.rb
fastlane/lib/fastlane/actions/update_project_team.rb
module Fastlane module Actions module SharedValues end class UpdateProjectTeamAction < Action def self.run(params) project_path = params[:path] selected_targets = params[:targets] UI.user_error!("Could not find path to xcodeproj '#{project_path}'. Pass the path to your project (not workspace)!") unless File.exist?(project_path) # Load .xcodeproj project = Xcodeproj::Project.open(project_path) # Fetch target targets = project.native_targets if selected_targets # Error to user if invalid target diff_targets = selected_targets - targets.map(&:name) UI.user_error!("Could not find target(s) in the project '#{project_path}' - #{diff_targets.join(',')}") unless diff_targets.empty? targets.select! { |native_target| selected_targets.include?(native_target.name) } end # Set teamid in target targets.each do |target| UI.message("Updating development team (#{params[:teamid]}) for target `#{target.name}` in the project '#{project_path}'") # Update the build settings target.build_configurations.each do |configuration| configuration.build_settings['DEVELOPMENT_TEAM'] = params[:teamid] end project.save UI.success("Successfully updated project settings to use Developer Team ID '#{params[:teamid]}' for target `#{target.name}`") end end def self.description "Update Xcode Development Team ID" end def self.details "This action updates the Developer Team ID of your Xcode project." end def self.available_options [ FastlaneCore::ConfigItem.new(key: :path, env_name: "FL_PROJECT_SIGNING_PROJECT_PATH", description: "Path to your Xcode project", default_value: Dir['*.xcodeproj'].first, default_value_dynamic: true, verify_block: proc do |value| UI.user_error!("Path is invalid") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :targets, env_name: "FL_PROJECT_TARGET", description: "Name of the targets you want to update", type: Array, optional: true), FastlaneCore::ConfigItem.new(key: :teamid, env_name: "FL_PROJECT_TEAM_ID", description: "The Team ID you want to use", code_gen_sensitive: true, default_value: ENV["TEAM_ID"] || CredentialsManager::AppfileConfig.try_fetch_value(:team_id), default_value_dynamic: true) ] end def self.author "lgaches" end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'update_project_team', 'update_project_team( path: "Example.xcodeproj", teamid: "A3ZZVJ7CNY" )' ] end def self.category :project end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/notify.rb
fastlane/lib/fastlane/actions/notify.rb
module Fastlane module Actions class NotifyAction < Action def self.run(params) require 'terminal-notifier' UI.important("It's recommended to use the new 'notification' method instead of 'notify'") text = params.join(' ') TerminalNotifier.notify(text, title: 'fastlane') end def self.description "Shows a macOS notification - use `notification` instead" end def self.author ["champo", "KrauseFx"] end def self.available_options end def self.is_supported?(platform) Helper.mac? end def self.example_code nil end def self.category :deprecated end def self.deprecated_notes "It's recommended to use the new `notification` action instead of `notify`" end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/appium.rb
fastlane/lib/fastlane/actions/appium.rb
module Fastlane module Actions class AppiumAction < Action INVOKE_TIMEOUT = 30 APPIUM_PATH_HOMEBREW = '/usr/local/bin/appium' APPIUM_APP_PATH = '/Applications/Appium.app' APPIUM_APP_BUNDLE_PATH = 'Contents/Resources/node_modules/.bin/appium' def self.run(params) Actions.verify_gem!('rspec') Actions.verify_gem!('appium_lib') require 'rspec' require 'appium_lib' unless Helper.test? FastlaneCore::PrintTable.print_values( config: params, title: "Summary for Appium Action" ) if params[:invoke_appium_server] appium_pid = invoke_appium_server(params) wait_for_appium_server(params) end configure_rspec(params) rspec_args = [] rspec_args << params[:spec_path] status = RSpec::Core::Runner.run(rspec_args).to_i if status != 0 UI.user_error!("Failed to run Appium spec. status code: #{status}") end ensure Actions.sh("kill #{appium_pid}") if appium_pid end def self.invoke_appium_server(params) appium = detect_appium(params) Process.spawn("#{appium} -a #{params[:host]} -p #{params[:port]}") end def self.detect_appium(params) appium_path = params[:appium_path] || `which appium`.to_s.strip if appium_path.empty? if File.exist?(APPIUM_PATH_HOMEBREW) appium_path = APPIUM_PATH_HOMEBREW elsif File.exist?(APPIUM_APP_PATH) appium_path = APPIUM_APP_PATH end end unless File.exist?(appium_path) UI.user_error!("You have to install Appium using `npm install -g appium`") end if appium_path.end_with?('.app') appium_path = "#{appium_path}/#{APPIUM_APP_BUNDLE_PATH}" end UI.message("Appium executable detected: #{appium_path}") appium_path end def self.wait_for_appium_server(params) loop.with_index do |_, count| break if `lsof -i:#{params[:port]}`.to_s.length != 0 if count * 5 > INVOKE_TIMEOUT UI.user_error!("Invoke Appium server timed out") end sleep(5) end end def self.configure_rspec(params) RSpec.configure do |c| c.before(:each) do caps = params[:caps] || {} caps[:platformName] ||= params[:platform] caps[:autoAcceptAlerts] ||= true caps[:app] = params[:app_path] appium_lib = params[:appium_lib] || {} @driver = Appium::Driver.new( caps: caps, server_url: params[:host], port: params[:port], appium_lib: appium_lib ).start_driver Appium.promote_appium_methods(RSpec::Core::ExampleGroup) end c.after(:each) do @driver.quit unless @driver.nil? end end end def self.description 'Run UI test by Appium with RSpec' end def self.available_options [ FastlaneCore::ConfigItem.new(key: :platform, env_name: 'FL_APPIUM_PLATFORM', description: 'Appium platform name'), FastlaneCore::ConfigItem.new(key: :spec_path, env_name: 'FL_APPIUM_SPEC_PATH', description: 'Path to Appium spec directory'), FastlaneCore::ConfigItem.new(key: :app_path, env_name: 'FL_APPIUM_APP_FILE_PATH', description: 'Path to Appium target app file'), FastlaneCore::ConfigItem.new(key: :invoke_appium_server, env_name: 'FL_APPIUM_INVOKE_APPIUM_SERVER', description: 'Use local Appium server with invoke automatically', type: Boolean, default_value: true, optional: true), FastlaneCore::ConfigItem.new(key: :host, env_name: 'FL_APPIUM_HOST', description: 'Hostname of Appium server', default_value: '0.0.0.0', optional: true), FastlaneCore::ConfigItem.new(key: :port, env_name: 'FL_APPIUM_PORT', description: 'HTTP port of Appium server', type: Integer, default_value: 4723, optional: true), FastlaneCore::ConfigItem.new(key: :appium_path, env_name: 'FL_APPIUM_EXECUTABLE_PATH', description: 'Path to Appium executable', optional: true), FastlaneCore::ConfigItem.new(key: :caps, env_name: 'FL_APPIUM_CAPS', description: 'Hash of caps for Appium::Driver', type: Hash, optional: true), FastlaneCore::ConfigItem.new(key: :appium_lib, env_name: 'FL_APPIUM_LIB', description: 'Hash of appium_lib for Appium::Driver', type: Hash, optional: true) ] end def self.author 'yonekawa' end def self.is_supported?(platform) [:ios, :android].include?(platform) end def self.category :testing end def self.example_code [ 'appium( app_path: "appium/apps/TargetApp.app", spec_path: "appium/spec", platform: "iOS", caps: { versionNumber: "9.1", deviceName: "iPhone 6" }, appium_lib: { wait: 10 } )' ] end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/clean_cocoapods_cache.rb
fastlane/lib/fastlane/actions/clean_cocoapods_cache.rb
module Fastlane module Actions class CleanCocoapodsCacheAction < Action def self.run(params) Actions.verify_gem!('cocoapods') cmd = ['pod cache clean'] cmd << params[:name].to_s if params[:name] cmd << '--no-ansi' if params[:no_ansi] cmd << '--verbose' if params[:verbose] cmd << '--silent' if params[:silent] cmd << '--allow-root' if params[:allow_root] cmd << '--all' Actions.sh(cmd.join(' ')) end def self.description 'Remove the cache for pods' end def self.available_options [ FastlaneCore::ConfigItem.new(key: :name, env_name: "FL_CLEAN_COCOAPODS_CACHE_DEVELOPMENT", description: "Pod name to be removed from cache", optional: true, verify_block: proc do |value| UI.user_error!("You must specify pod name which should be removed from cache") if value.to_s.empty? end), FastlaneCore::ConfigItem.new(key: :no_ansi, env_name: "FL_CLEAN_COCOAPODS_CACHE_NO_ANSI", description: "Show output without ANSI codes", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :verbose, env_name: "FL_CLEAN_COCOAPODS_CACHE_VERBOSE", description: "Show more debugging information", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :silent, env_name: "FL_CLEAN_COCOAPODS_CACHE_SILENT", description: "Show nothing", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :allow_root, env_name: "FL_CLEAN_COCOAPODS_CACHE_ALLOW_ROOT", description: "Allows CocoaPods to run as root", type: Boolean, default_value: false) ] end def self.authors ["alexmx"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'clean_cocoapods_cache', 'clean_cocoapods_cache(name: "CACHED_POD")' ] end def self.category :building end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/update_project_provisioning.rb
fastlane/lib/fastlane/actions/update_project_provisioning.rb
# coding: utf-8 module Fastlane module Actions module SharedValues end class UpdateProjectProvisioningAction < Action ROOT_CERTIFICATE_URL = "https://www.apple.com/appleca/AppleIncRootCertificate.cer" def self.run(params) UI.message("You’re updating provisioning profiles directly in your project, but have you considered easier ways to do code signing?") UI.message("https://docs.fastlane.tools/codesigning/GettingStarted/") # assign folder from parameter or search for xcodeproj file folder = params[:xcodeproj] || Dir["*.xcodeproj"].first # validate folder project_file_path = File.join(folder, "project.pbxproj") UI.user_error!("Could not find path to project config '#{project_file_path}'. Pass the path to your project (not workspace)!") unless File.exist?(project_file_path) # download certificate unless File.exist?(params[:certificate]) && File.size(params[:certificate]) > 0 UI.message("Downloading root certificate from (#{ROOT_CERTIFICATE_URL}) to path '#{params[:certificate]}'") require 'open-uri' File.open(params[:certificate], "w:ASCII-8BIT") do |file| file.write(URI.open(ROOT_CERTIFICATE_URL, "rb").read) end end # parsing mobileprovision file UI.message("Parsing mobile provisioning profile from '#{params[:profile]}'") profile = File.read(params[:profile]) p7 = OpenSSL::PKCS7.new(profile) store = OpenSSL::X509::Store.new UI.user_error!("Could not find valid certificate at '#{params[:certificate]}'") unless File.size(params[:certificate]) > 0 cert = OpenSSL::X509::Certificate.new(File.read(params[:certificate])) store.add_cert(cert) p7.verify([cert], store) check_verify!(p7) data = Plist.parse_xml(p7.data) target_filter = params[:target_filter] || params[:build_configuration_filter] configuration = params[:build_configuration] code_signing_identity = params[:code_signing_identity] # manipulate project file UI.success("Going to update project '#{folder}' with UUID") require 'xcodeproj' project = Xcodeproj::Project.open(folder) project.targets.each do |target| if !target_filter || target.name.match(target_filter) || (target.respond_to?(:product_type) && target.product_type.match(target_filter)) UI.success("Updating target #{target.name}...") else UI.important("Skipping target #{target.name} as it doesn't match the filter '#{target_filter}'") next end target.build_configuration_list.build_configurations.each do |build_configuration| config_name = build_configuration.name if !configuration || config_name.match(configuration) UI.success("Updating configuration #{config_name}...") else UI.important("Skipping configuration #{config_name} as it doesn't match the filter '#{configuration}'") next end if code_signing_identity codesign_build_settings_keys = build_configuration.build_settings.keys.select { |key| key.to_s.match(/CODE_SIGN_IDENTITY.*/) } codesign_build_settings_keys.each do |setting| build_configuration.build_settings[setting] = code_signing_identity end end build_configuration.build_settings["PROVISIONING_PROFILE"] = data["UUID"] build_configuration.build_settings["PROVISIONING_PROFILE_SPECIFIER"] = data["Name"] end end project.save # complete UI.success("Successfully updated project settings in '#{folder}'") end def self.check_verify!(p7) failed_to_verify = (p7.data.nil? || p7.data == "") && !(p7.error_string || "").empty? if failed_to_verify UI.crash!("Profile could not be verified with error: '#{p7.error_string}'. Try regenerating provisioning profile.") end end def self.description "Update projects code signing settings from your provisioning profile" end def self.details [ "You should check out the [code signing guide](https://docs.fastlane.tools/codesigning/getting-started/) before using this action.", "This action retrieves a provisioning profile UUID from a provisioning profile (`.mobileprovision`) to set up the Xcode projects' code signing settings in `*.xcodeproj/project.pbxproj`.", "The `:target_filter` value can be used to only update code signing for the specified targets.", "The `:build_configuration` value can be used to only update code signing for the specified build configurations of the targets passing through the `:target_filter`.", "Example usage is the WatchKit Extension or WatchKit App, where you need separate provisioning profiles.", "Example: `update_project_provisioning(xcodeproj: \"..\", target_filter: \".*WatchKit App.*\")`." ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :xcodeproj, env_name: "FL_PROJECT_PROVISIONING_PROJECT_PATH", description: "Path to your Xcode project", optional: true, verify_block: proc do |value| UI.user_error!("Path to xcode project is invalid") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :profile, env_name: "FL_PROJECT_PROVISIONING_PROFILE_FILE", description: "Path to provisioning profile (.mobileprovision)", default_value: Actions.lane_context[SharedValues::SIGH_PROFILE_PATH], default_value_dynamic: true, verify_block: proc do |value| UI.user_error!("Path to provisioning profile is invalid") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :target_filter, env_name: "FL_PROJECT_PROVISIONING_PROFILE_TARGET_FILTER", description: "A filter for the target name. Use a standard regex", optional: true, skip_type_validation: true, # allow Regexp, String verify_block: proc do |value| UI.user_error!("target_filter should be Regexp or String") unless [Regexp, String].any? { |type| value.kind_of?(type) } end), FastlaneCore::ConfigItem.new(key: :build_configuration_filter, env_name: "FL_PROJECT_PROVISIONING_PROFILE_FILTER", description: "Legacy option, use 'target_filter' instead", optional: true), FastlaneCore::ConfigItem.new(key: :build_configuration, env_name: "FL_PROJECT_PROVISIONING_PROFILE_BUILD_CONFIGURATION", description: "A filter for the build configuration name. Use a standard regex. Applied to all configurations if not specified", optional: true, skip_type_validation: true, # allow Regexp, String verify_block: proc do |value| UI.user_error!("build_configuration should be Regexp or String") unless [Regexp, String].any? { |type| value.kind_of?(type) } end), FastlaneCore::ConfigItem.new(key: :certificate, env_name: "FL_PROJECT_PROVISIONING_CERTIFICATE_PATH", description: "Path to apple root certificate", default_value: "/tmp/AppleIncRootCertificate.cer"), FastlaneCore::ConfigItem.new(key: :code_signing_identity, env_name: "FL_PROJECT_PROVISIONING_CODE_SIGN_IDENTITY", description: "Code sign identity for build configuration", optional: true) ] end def self.authors ["tobiasstrebitzer", "czechboy0"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'update_project_provisioning( xcodeproj: "Project.xcodeproj", profile: "./watch_app_store.mobileprovision", # optional if you use sigh target_filter: ".*WatchKit Extension.*", # matches name or type of a target build_configuration: "Release", code_signing_identity: "iPhone Development" # optionally specify the codesigning identity )' ] end def self.category :code_signing end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/get_build_number_repository.rb
fastlane/lib/fastlane/actions/get_build_number_repository.rb
module Fastlane module Actions module SharedValues BUILD_NUMBER_REPOSITORY = :BUILD_NUMBER_REPOSITORY end class GetBuildNumberRepositoryAction < Action def self.is_svn? Actions.sh('svn info') return true rescue return false end def self.is_git? Actions.sh('git rev-parse HEAD') return true rescue return false end def self.is_git_svn? Actions.sh('git svn info') return true rescue return false end def self.is_hg? Actions.sh('hg status') return true rescue return false end def self.command(use_hg_revision_number) if is_svn? UI.message("Detected repo: svn") return 'svn info | grep Revision | egrep -o "[0-9]+"' elsif is_git_svn? UI.message("Detected repo: git-svn") return 'git svn info | grep Revision | egrep -o "[0-9]+"' elsif is_git? UI.message("Detected repo: git") return 'git rev-parse --short HEAD' elsif is_hg? UI.message("Detected repo: hg") if use_hg_revision_number return 'hg parent --template {rev}' else return 'hg parent --template "{node|short}"' end else UI.user_error!("No repository detected") end end def self.run(params) build_number = Action.sh(command(params[:use_hg_revision_number])).strip Actions.lane_context[SharedValues::BUILD_NUMBER_REPOSITORY] = build_number return build_number end ##################################################### # @!group Documentation ##################################################### def self.description "Get the build number from the current repository" end def self.details [ "This action will get the **build number** according to what the SCM HEAD reports.", "Currently supported SCMs are svn (uses root revision), git-svn (uses svn revision), git (uses short hash) and mercurial (uses short hash or revision number).", "There is an option, `:use_hg_revision_number`, which allows to use mercurial revision number instead of hash." ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :use_hg_revision_number, env_name: "USE_HG_REVISION_NUMBER", description: "Use hg revision number instead of hash (ignored for non-hg repos)", optional: true, type: Boolean, default_value: false) ] end def self.output [ ['BUILD_NUMBER_REPOSITORY', 'The build number from the current repository'] ] end def self.return_value "The build number from the current repository" end def self.authors ["bartoszj", "pbrooks", "armadsen"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'get_build_number_repository' ] end def self.category :source_control end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/download_universal_apk_from_google_play.rb
fastlane/lib/fastlane/actions/download_universal_apk_from_google_play.rb
require 'supply' require 'supply/options' module Fastlane module Actions class DownloadUniversalApkFromGooglePlayAction < Action def self.run(params) package_name = params[:package_name] version_code = params[:version_code] destination = params[:destination] cert_sha = params[:certificate_sha256_hash] client = Supply::Client.make_from_config(params: params) UI.message("Fetching the list of generated APKs from the Google API...") all_universal_apks = client.list_generated_universal_apks(package_name: package_name, version_code: version_code) matching_apks = all_universal_apks.select { |apk| cert_sha.nil? || apk.certificate_sha256_hash&.casecmp?(cert_sha) } all_certs_printable_list = all_universal_apks.map { |apk| " - #{apk.certificate_sha256_hash}" } if matching_apks.count > 1 message = <<~ERROR We found multiple Generated Universal APK, with the following `certificate_sha256_hash`: #{all_certs_printable_list.join("\n")} Use the `certificate_sha256_hash` parameter to specify which one to download. ERROR UI.user_error!(message) elsif matching_apks.empty? # NOTE: if no APK was found at all to begin with, the client would already have raised a user_error!('Google Api Error ...') message = <<~ERROR None of the Universal APK(s) found for this version code matched the `certificate_sha256_hash` of `#{cert_sha}`. We found #{all_universal_apks.count} Generated Universal APK(s), but with a different `certificate_sha256_hash`: #{all_certs_printable_list.join("\n")} ERROR UI.user_error!(message) end UI.message("Downloading Generated Universal APK to `#{destination}`...") FileUtils.mkdir_p(File.dirname(destination)) client.download_generated_universal_apk(generated_universal_apk: matching_apks.first, destination: destination) UI.success("Universal APK successfully downloaded to `#{destination}`.") destination end ##################################################### # @!group Documentation ##################################################### def self.description "Download the Universal APK of a given version code from the Google Play Console" end def self.details <<~DETAILS Download the universal APK of a given version code from the Google Play Console. This uses _fastlane_ `supply` (and the `AndroidPublisher` Google API) to download the Universal APK generated by Google after you uploaded an `.aab` bundle to the Play Console. See https://developers.google.com/android-publisher/api-ref/rest/v3/generatedapks/list DETAILS end def self.available_options # Only borrow _some_ of the ConfigItems from https://github.com/fastlane/fastlane/blob/master/supply/lib/supply/options.rb # So we don't have to duplicate the name, env_var, type, description, and verify_block of those here. supply_borrowed_options = Supply::Options.available_options.select do |o| %i[package_name version_code json_key json_key_data root_url timeout].include?(o.key) end # Adjust the description for the :version_code ConfigItem for our action's use case supply_borrowed_options.find { |o| o.key == :version_code }&.description = "The versionCode for which to download the generated APK" [ *supply_borrowed_options, # The remaining ConfigItems below are specific to this action FastlaneCore::ConfigItem.new(key: :destination, env_name: 'DOWNLOAD_UNIVERSAL_APK_DESTINATION', optional: false, type: String, description: "The path on disk where to download the Generated Universal APK", verify_block: proc do |value| UI.user_error!("The 'destination' must be a file path with the `.apk` file extension") unless File.extname(value) == '.apk' end), FastlaneCore::ConfigItem.new(key: :certificate_sha256_hash, env_name: 'DOWNLOAD_UNIVERSAL_APK_CERTIFICATE_SHA256_HASH', optional: true, type: String, description: "The SHA256 hash of the signing key for which to download the Universal, Code-Signed APK for. " \ + "Use 'xx:xx:xx:…' format (32 hex bytes separated by colons), as printed by `keytool -list -keystore <keystorefile>`. " \ + "Only useful to provide if you have multiple signing keys configured on GPC, to specify which generated APK to download", verify_block: proc do |value| bytes = value.split(':') next if bytes.length == 32 && bytes.all? { |byte| /^[0-9a-fA-F]{2}$/.match?(byte) } UI.user_error!("When provided, the certificate sha256 must be in the 'xx:xx:xx:…:xx' (32 hex bytes separated by colons) format") end) ] end def self.output # Define the shared values you are going to provide end def self.return_value 'The path to the downloaded Universal APK. The action will raise an exception if it failed to find or download the APK in Google Play' end def self.authors ['Automattic'] end def self.category :production end def self.is_supported?(platform) platform == :android end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/update_code_signing_settings.rb
fastlane/lib/fastlane/actions/update_code_signing_settings.rb
require 'xcodeproj' module Fastlane module Actions class UpdateCodeSigningSettingsAction < Action def self.run(params) FastlaneCore::PrintTable.print_values(config: params, title: "Summary for code signing settings") path = params[:path] path = File.join(File.expand_path(path), "project.pbxproj") project = Xcodeproj::Project.open(params[:path]) UI.user_error!("Could not find path to project config '#{path}'. Pass the path to your project (not workspace)!") unless File.exist?(path) UI.message("Updating the Automatic Codesigning flag to #{params[:use_automatic_signing] ? 'enabled' : 'disabled'} for the given project '#{path}'") unless project.root_object.attributes["TargetAttributes"] UI.user_error!("Seems to be a very old project file format - please open your project file in a more recent version of Xcode") return false end changed_targets = [] changed_build_configurations = [] project.targets.each do |target| if params[:targets] unless params[:targets].include?(target.name) UI.important("Skipping #{target.name} not selected (#{params[:targets].join(',')})") next end end target.build_configurations.each do |config| if params[:build_configurations] unless params[:build_configurations].include?(config.name) UI.important("Skipping #{config.name} not selected (#{params[:build_configurations].join(',')})") next end end style_value = params[:use_automatic_signing] ? 'Automatic' : 'Manual' development_team_setting = params[:sdk] ? "DEVELOPMENT_TEAM[sdk=#{params[:sdk]}]" : "DEVELOPMENT_TEAM" code_sign_identity_setting = params[:sdk] ? "CODE_SIGN_IDENTITY[sdk=#{params[:sdk]}]" : "CODE_SIGN_IDENTITY" provisioning_profile_setting = params[:sdk] ? "PROVISIONING_PROFILE_SPECIFIER[sdk=#{params[:sdk]}]" : "PROVISIONING_PROFILE_SPECIFIER" set_build_setting(config, "CODE_SIGN_STYLE", style_value) if params[:team_id] set_build_setting(config, development_team_setting, params[:team_id]) UI.important("Set Team id to: #{params[:team_id]} for target: #{target.name} for build configuration: #{config.name}") end if params[:code_sign_identity] set_build_setting(config, code_sign_identity_setting, params[:code_sign_identity]) UI.important("Set Code Sign identity to: #{params[:code_sign_identity]} for target: #{target.name} for build configuration: #{config.name}") end if params[:profile_name] set_build_setting(config, provisioning_profile_setting, params[:profile_name]) UI.important("Set Provisioning Profile name to: #{params[:profile_name]} for target: #{target.name} for build configuration: #{config.name}") end if params[:entitlements_file_path] set_build_setting(config, "CODE_SIGN_ENTITLEMENTS", params[:entitlements_file_path]) UI.important("Set Entitlements file path to: #{params[:entitlements_file_path]} for target: #{target.name} for build configuration: #{config.name}") end # Since Xcode 8, this is no longer needed, you simply use PROVISIONING_PROFILE_SPECIFIER if params[:profile_uuid] set_build_setting(config, "PROVISIONING_PROFILE", params[:profile_uuid]) UI.important("Set Provisioning Profile UUID to: #{params[:profile_uuid]} for target: #{target.name} for build configuration: #{config.name}") end if params[:bundle_identifier] set_build_setting(config, "PRODUCT_BUNDLE_IDENTIFIER", params[:bundle_identifier]) UI.important("Set Bundle identifier to: #{params[:bundle_identifier]} for target: #{target.name} for build configuration: #{config.name}") end changed_build_configurations << config.name end changed_targets << target.name end project.save if changed_targets.empty? UI.important("None of the specified targets has been modified") UI.important("available targets:") project.targets.each do |target| UI.important("\t* #{target.name}") end else UI.success("Successfully updated project settings to use Code Sign Style = '#{params[:use_automatic_signing] ? 'Automatic' : 'Manual'}'") UI.success("Modified Targets:") changed_targets.each do |target| UI.success("\t * #{target}") end UI.success("Modified Build Configurations:") changed_build_configurations.each do |name| UI.success("\t * #{name}") end end params[:use_automatic_signing] end def self.set_build_setting(configuration, name, value) # Iterate over any keys that start with this name # This will also set keys that have filtering like [sdk=iphoneos*] keys = configuration.build_settings.keys.select { |key| key.to_s.match(/#{name}.*/) } keys.each do |key| configuration.build_settings[key] = value end # Explicitly set the key with value if keys don't exist configuration.build_settings[name] = value end def self.description "Configures Xcode's Codesigning options" end def self.details "Configures Xcode's Codesigning options of all targets in the project" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :path, env_name: "FL_PROJECT_SIGNING_PROJECT_PATH", description: "Path to your Xcode project", code_gen_sensitive: true, default_value: Dir['*.xcodeproj'].first, default_value_dynamic: true, verify_block: proc do |value| UI.user_error!("Path is invalid") unless File.exist?(File.expand_path(value)) end), FastlaneCore::ConfigItem.new(key: :use_automatic_signing, env_name: "FL_PROJECT_USE_AUTOMATIC_SIGNING", description: "Defines if project should use automatic signing", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :sdk, env_name: "FASTLANE_BUILD_SDK", optional: true, description: "Build target SDKs (iphoneos*, macosx*, iphonesimulator*)"), FastlaneCore::ConfigItem.new(key: :team_id, env_name: "FASTLANE_TEAM_ID", optional: true, description: "Team ID, is used when upgrading project"), FastlaneCore::ConfigItem.new(key: :targets, env_name: "FL_PROJECT_SIGNING_TARGETS", optional: true, type: Array, description: "Specify targets you want to toggle the signing mech. (default to all targets)"), FastlaneCore::ConfigItem.new(key: :build_configurations, env_name: "FL_PROJECT_SIGNING_BUILD_CONFIGURATIONS", optional: true, type: Array, description: "Specify build_configurations you want to toggle the signing mech. (default to all configurations)"), FastlaneCore::ConfigItem.new(key: :code_sign_identity, env_name: "FL_CODE_SIGN_IDENTITY", description: "Code signing identity type (iPhone Developer, iPhone Distribution)", optional: true), FastlaneCore::ConfigItem.new(key: :entitlements_file_path, env_name: "FL_CODE_SIGN_ENTITLEMENTS_FILE_PATH", description: "Path to your entitlements file", optional: true), FastlaneCore::ConfigItem.new(key: :profile_name, env_name: "FL_PROVISIONING_PROFILE_SPECIFIER", description: "Provisioning profile name to use for code signing", optional: true), FastlaneCore::ConfigItem.new(key: :profile_uuid, env_name: "FL_PROVISIONING_PROFILE", description: "Provisioning profile UUID to use for code signing", optional: true), FastlaneCore::ConfigItem.new(key: :bundle_identifier, env_name: "FL_APP_IDENTIFIER", description: "Application Product Bundle Identifier", optional: true) ] end def self.output end def self.example_code [ ' # manual code signing update_code_signing_settings( use_automatic_signing: false, path: "demo-project/demo/demo.xcodeproj" )', ' # automatic code signing update_code_signing_settings( use_automatic_signing: true, path: "demo-project/demo/demo.xcodeproj" )', ' # more advanced manual code signing update_code_signing_settings( use_automatic_signing: false, path: "demo-project/demo/demo.xcodeproj", team_id: "QABC123DEV", bundle_identifier: "com.demoapp.QABC123DEV", code_sign_identity: "iPhone Distribution", sdk: "iphoneos*", profile_name: "Demo App Deployment Profile", entitlements_file_path: "Demo App/generated/New.entitlements" )' ] end def self.category :code_signing end def self.return_value "The current status (boolean) of codesigning after modification" end def self.authors ["mathiasAichinger", "hjanuschka", "p4checo", "portellaa", "aeons", "att55", "abcdev"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/add_git_tag.rb
fastlane/lib/fastlane/actions/add_git_tag.rb
module Fastlane module Actions # Adds a git tag to the current commit class AddGitTagAction < Action def self.run(options) # lane name in lane_context could be nil because you can just call $fastlane add_git_tag which has no context lane_name = Actions.lane_context[Actions::SharedValues::LANE_NAME].to_s.delete(' ') # no spaces allowed if options[:tag] tag = options[:tag] elsif options[:build_number] tag_components = [options[:grouping]] tag_components << lane_name if options[:includes_lane] tag_components << "#{options[:prefix]}#{options[:build_number]}#{options[:postfix]}" tag = tag_components.join('/') else UI.user_error!("No value found for 'tag' or 'build_number'. At least one of them must be provided. Note that if you do specify a tag, all other arguments are ignored.") end message = options[:message] || "#{tag} (fastlane)" cmd = ['git tag'] cmd << ["-am #{message.shellescape}"] cmd << '--force' if options[:force] cmd << '-s' if options[:sign] cmd << tag.shellescape cmd << options[:commit].to_s if options[:commit] UI.message("Adding git tag '#{tag}' 🎯.") Actions.sh(cmd.join(' ')) end def self.description "This will add an annotated git tag to the current branch" end def self.details list = <<-LIST.markdown_list `grouping` is just to keep your tags organised under one 'folder', defaults to 'builds' `lane` is the name of the current fastlane lane, if chosen to be included via 'includes_lane' option, which defaults to 'true' `prefix` is anything you want to stick in front of the version number, e.g. 'v' `postfix` is anything you want to stick at the end of the version number, e.g. '-RC1' `build_number` is the build number, which defaults to the value emitted by the `increment_build_number` action LIST [ "This will automatically tag your build with the following format: `<grouping>/<lane>/<prefix><build_number><postfix>`, where:".markdown_preserve_newlines, list, "For example, for build 1234 in the 'appstore' lane, it will tag the commit with `builds/appstore/1234`." ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :tag, env_name: "FL_GIT_TAG_TAG", description: "Define your own tag text. This will replace all other parameters", optional: true), FastlaneCore::ConfigItem.new(key: :grouping, env_name: "FL_GIT_TAG_GROUPING", description: "Is used to keep your tags organised under one 'folder'", default_value: 'builds'), FastlaneCore::ConfigItem.new(key: :includes_lane, env_name: "FL_GIT_TAG_INCLUDES_LANE", description: "Whether the current lane should be included in the tag and message composition, e.g. '<grouping>/<lane>/<prefix><build_number><postfix>'", type: Boolean, default_value: true), FastlaneCore::ConfigItem.new(key: :prefix, env_name: "FL_GIT_TAG_PREFIX", description: "Anything you want to put in front of the version number (e.g. 'v')", default_value: ''), FastlaneCore::ConfigItem.new(key: :postfix, env_name: "FL_GIT_TAG_POSTFIX", description: "Anything you want to put at the end of the version number (e.g. '-RC1')", default_value: ''), FastlaneCore::ConfigItem.new(key: :build_number, env_name: "FL_GIT_TAG_BUILD_NUMBER", description: "The build number. Defaults to the result of increment_build_number if you\'re using it", default_value: Actions.lane_context[Actions::SharedValues::BUILD_NUMBER], default_value_dynamic: true, skip_type_validation: true, # skipping validation because we both allow integer and string optional: true), FastlaneCore::ConfigItem.new(key: :message, env_name: "FL_GIT_TAG_MESSAGE", description: "The tag message. Defaults to the tag's name", default_value_dynamic: true, optional: true), FastlaneCore::ConfigItem.new(key: :commit, env_name: "FL_GIT_TAG_COMMIT", description: "The commit or object where the tag will be set. Defaults to the current HEAD", default_value_dynamic: true, optional: true), FastlaneCore::ConfigItem.new(key: :force, env_name: "FL_GIT_TAG_FORCE", description: "Force adding the tag", optional: true, type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :sign, env_name: "FL_GIT_TAG_SIGN", description: "Make a GPG-signed tag, using the default e-mail address's key", optional: true, type: Boolean, default_value: false) ] end def self.example_code [ 'add_git_tag # simple tag with default values', 'add_git_tag( grouping: "fastlane-builds", includes_lane: true, prefix: "v", postfix: "-RC1", build_number: 123 )', '# Alternatively, you can specify your own tag. Note that if you do specify a tag, all other arguments are ignored. add_git_tag( tag: "my_custom_tag" )' ] end def self.category :source_control end def self.authors ["lmirosevic", "maschall"] end def self.is_supported?(platform) true end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/bundle_install.rb
fastlane/lib/fastlane/actions/bundle_install.rb
module Fastlane module Actions class BundleInstallAction < Action # rubocop:disable Metrics/PerceivedComplexity def self.run(params) if gemfile_exists?(params) cmd = ['bundle install'] cmd << "--binstubs #{params[:binstubs]}" if params[:binstubs] cmd << "--clean" if params[:clean] cmd << "--full-index" if params[:full_index] cmd << "--gemfile #{params[:gemfile]}" if params[:gemfile] cmd << "--jobs #{params[:jobs]}" if params[:jobs] cmd << "--local" if params[:local] cmd << "--deployment" if params[:deployment] cmd << "--no-cache" if params[:no_cache] cmd << "--no_prune" if params[:no_prune] cmd << "--path #{params[:path]}" if params[:path] cmd << "--system" if params[:system] cmd << "--quiet" if params[:quiet] cmd << "--retry #{params[:retry]}" if params[:retry] cmd << "--shebang" if params[:shebang] cmd << "--standalone #{params[:standalone]}" if params[:standalone] cmd << "--trust-policy" if params[:trust_policy] cmd << "--without #{params[:without]}" if params[:without] cmd << "--with #{params[:with]}" if params[:with] cmd << "--frozen" if params[:frozen] cmd << "--redownload" if params[:redownload] return sh(cmd.join(' ')) else UI.message("No Gemfile found") end end # rubocop:enable Metrics/PerceivedComplexity def self.gemfile_exists?(params) possible_gemfiles = ['Gemfile', 'gemfile'] possible_gemfiles.insert(0, params[:gemfile]) if params[:gemfile] possible_gemfiles.each do |gemfile| gemfile = File.absolute_path(gemfile) return true if File.exist?(gemfile) UI.message("Gemfile not found at: '#{gemfile}'") end return false end def self.description 'This action runs `bundle install` (if available)' end def self.is_supported?(platform) true end def self.author ["birmacher", "koglinjg"] end def self.example_code nil end def self.category :misc end def self.available_options [ FastlaneCore::ConfigItem.new(key: :binstubs, env_name: "FL_BUNDLE_INSTALL_BINSTUBS", description: "Generate bin stubs for bundled gems to ./bin", optional: true), FastlaneCore::ConfigItem.new(key: :clean, env_name: "FL_BUNDLE_INSTALL_CLEAN", description: "Run bundle clean automatically after install", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :full_index, env_name: "FL_BUNDLE_INSTALL_FULL_INDEX", description: "Use the rubygems modern index instead of the API endpoint", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :gemfile, env_name: "FL_BUNDLE_INSTALL_GEMFILE", description: "Use the specified gemfile instead of Gemfile", optional: true), FastlaneCore::ConfigItem.new(key: :jobs, env_name: "FL_BUNDLE_INSTALL_JOBS", description: "Install gems using parallel workers", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :local, env_name: "FL_BUNDLE_INSTALL_LOCAL", description: "Do not attempt to fetch gems remotely and use the gem cache instead", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :deployment, env_name: "FL_BUNDLE_INSTALL_DEPLOYMENT", description: "Install using defaults tuned for deployment and CI environments", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :no_cache, env_name: "FL_BUNDLE_INSTALL_NO_CACHE", description: "Don't update the existing gem cache", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :no_prune, env_name: "FL_BUNDLE_INSTALL_NO_PRUNE", description: "Don't remove stale gems from the cache", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :path, env_name: "FL_BUNDLE_INSTALL_PATH", description: "Specify a different path than the system default ($BUNDLE_PATH or $GEM_HOME). Bundler will remember this value for future installs on this machine", optional: true), FastlaneCore::ConfigItem.new(key: :system, env_name: "FL_BUNDLE_INSTALL_SYSTEM", description: "Install to the system location ($BUNDLE_PATH or $GEM_HOME) even if the bundle was previously installed somewhere else for this application", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :quiet, env_name: "FL_BUNDLE_INSTALL_QUIET", description: "Only output warnings and errors", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :retry, env_name: "FL_BUNDLE_INSTALL_RETRY", description: "Retry network and git requests that have failed", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :shebang, env_name: "FL_BUNDLE_INSTALL_SHEBANG", description: "Specify a different shebang executable name than the default (usually 'ruby')", optional: true), FastlaneCore::ConfigItem.new(key: :standalone, env_name: "FL_BUNDLE_INSTALL_STANDALONE", description: "Make a bundle that can work without the Bundler runtime", optional: true), FastlaneCore::ConfigItem.new(key: :trust_policy, env_name: "FL_BUNDLE_INSTALL_TRUST_POLICY", description: "Sets level of security when dealing with signed gems. Accepts `LowSecurity`, `MediumSecurity` and `HighSecurity` as values", optional: true), FastlaneCore::ConfigItem.new(key: :without, env_name: "FL_BUNDLE_INSTALL_WITHOUT", description: "Exclude gems that are part of the specified named group", optional: true), FastlaneCore::ConfigItem.new(key: :with, env_name: "FL_BUNDLE_INSTALL_WITH", description: "Include gems that are part of the specified named group", optional: true), FastlaneCore::ConfigItem.new(key: :frozen, env_name: "FL_BUNDLE_INSTALL_FROZEN", description: "Don't allow the Gemfile.lock to be updated after install", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :redownload, env_name: "FL_BUNDLE_INSTALL_REDOWNLOAD", description: "Force download every gem, even if the required versions are already available locally", type: Boolean, default_value: false) ] end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/twitter.rb
fastlane/lib/fastlane/actions/twitter.rb
module Fastlane module Actions class TwitterAction < Action def self.run(params) Actions.verify_gem!("twitter") require 'twitter' client = Twitter::REST::Client.new do |config| config.consumer_key = params[:consumer_key] config.consumer_secret = params[:consumer_secret] config.access_token = params[:access_token] config.access_token_secret = params[:access_token_secret] end client.update(params[:message]) UI.message(['[TWITTER]', "Successfully tweeted ", params[:message]].join(': ')) end ##################################################### # @!group Documentation ##################################################### def self.description "Post a tweet on [Twitter.com](https://twitter.com)" end def self.details "Post a tweet on Twitter. Requires you to setup an app on [twitter.com](https://twitter.com) and obtain `consumer` and `access_token`." end def self.available_options [ FastlaneCore::ConfigItem.new(key: :consumer_key, env_name: "FL_TW_CONSUMER_KEY", description: "Consumer Key", sensitive: true, optional: false), FastlaneCore::ConfigItem.new(key: :consumer_secret, env_name: "FL_TW_CONSUMER_SECRET", sensitive: true, description: "Consumer Secret", optional: false), FastlaneCore::ConfigItem.new(key: :access_token, env_name: "FL_TW_ACCESS_TOKEN", sensitive: true, description: "Access Token", optional: false), FastlaneCore::ConfigItem.new(key: :access_token_secret, env_name: "FL_TW_ACCESS_TOKEN_SECRET", sensitive: true, description: "Access Token Secret", optional: false), FastlaneCore::ConfigItem.new(key: :message, env_name: "FL_TW_MESSAGE", description: "The tweet", optional: false) ] end def self.authors ["hjanuschka"] end def self.is_supported?(platform) true end def self.example_code [ 'twitter( access_token: "XXXX", access_token_secret: "xxx", consumer_key: "xxx", consumer_secret: "xxx", message: "You rock!" )' ] end def self.category :notifications end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/set_pod_key.rb
fastlane/lib/fastlane/actions/set_pod_key.rb
module Fastlane module Actions class SetPodKeyAction < Action def self.run(params) Actions.verify_gem!('cocoapods-keys') cmd = [] cmd << ['bundle exec'] if params[:use_bundle_exec] && shell_out_should_use_bundle_exec? cmd << ['pod keys set'] cmd << ["\"#{params[:key]}\""] cmd << ["\"#{params[:value]}\""] cmd << ["\"#{params[:project]}\""] if params[:project] Actions.sh(cmd.join(' ')) end def self.author "marcelofabri" end ##################################################### # @!group Documentation ##################################################### def self.description "Sets a value for a key with cocoapods-keys" end def self.details "Adds a key to [cocoapods-keys](https://github.com/orta/cocoapods-keys)" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :use_bundle_exec, env_name: "FL_SET_POD_KEY_USE_BUNDLE_EXEC", description: "Use bundle exec when there is a Gemfile presented", type: Boolean, default_value: true), FastlaneCore::ConfigItem.new(key: :key, env_name: "FL_SET_POD_KEY_ITEM_KEY", description: "The key to be saved with cocoapods-keys", optional: false), FastlaneCore::ConfigItem.new(key: :value, env_name: "FL_SET_POD_KEY_ITEM_VALUE", description: "The value to be saved with cocoapods-keys", sensitive: true, code_gen_sensitive: true, optional: false), FastlaneCore::ConfigItem.new(key: :project, env_name: "FL_SET_POD_KEY_PROJECT", description: "The project name", optional: true) ] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'set_pod_key( key: "APIToken", value: "1234", project: "MyProject" )' ] end def self.category :project end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/appetize.rb
fastlane/lib/fastlane/actions/appetize.rb
module Fastlane module Actions module SharedValues APPETIZE_PUBLIC_KEY = :APPETIZE_PUBLIC_KEY APPETIZE_APP_URL = :APPETIZE_APP_URL APPETIZE_MANAGE_URL = :APPETIZE_MANAGE_URL APPETIZE_API_HOST = :APPETIZE_API_HOST end class AppetizeAction < Action def self.is_supported?(platform) [:ios, :android].include?(platform) end def self.run(options) require 'net/http' require 'net/http/post/multipart' require 'uri' require 'json' params = { platform: options[:platform] } if options[:path] params[:file] = UploadIO.new(options[:path], 'application/zip') else UI.user_error!('url parameter is required if no file path is specified') if options[:url].nil? params[:url] = options[:url] end params[:note] = options[:note] if options[:note].to_s.length > 0 if options[:timeout] params[:timeout] = options[:timeout] end uri = URI.parse(appetize_url(options)) req = create_request(uri, params) req.basic_auth(options[:api_token], nil) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true if params[:platform] == 'ios' UI.message("Uploading ipa to appetize... this might take a while") else UI.message("Uploading apk to appetize... this might take a while") end response = http.request(req) unless response.code.to_i.between?(200, 299) UI.user_error!("Error uploading to Appetize.io: received HTTP #{response.code} with body #{response.body}") end parse_response(response) # this will raise an exception if something goes wrong UI.message("App URL: #{Actions.lane_context[SharedValues::APPETIZE_APP_URL]}") UI.message("Manage URL: #{Actions.lane_context[SharedValues::APPETIZE_MANAGE_URL]}") UI.message("Public Key: #{Actions.lane_context[SharedValues::APPETIZE_PUBLIC_KEY]}") UI.success("Build successfully uploaded to Appetize.io") end def self.appetize_url(options) Actions.lane_context[SharedValues::APPETIZE_API_HOST] = options[:api_host] "https://#{options[:api_host]}/v1/apps/#{options[:public_key]}" end private_class_method :appetize_url def self.create_request(uri, params) if params[:url] req = Net::HTTP::Post.new(uri.request_uri, { 'Content-Type' => 'application/json' }) req.body = JSON.generate(params) else req = Net::HTTP::Post::Multipart.new(uri.path, params) end req end private_class_method :create_request def self.parse_response(response) body = JSON.parse(response.body) app_url = body['appURL'] manage_url = body['manageURL'] public_key = body['publicKey'] Actions.lane_context[SharedValues::APPETIZE_PUBLIC_KEY] = public_key Actions.lane_context[SharedValues::APPETIZE_APP_URL] = app_url Actions.lane_context[SharedValues::APPETIZE_MANAGE_URL] = manage_url return true rescue => ex UI.error(ex) UI.user_error!("Error uploading to Appetize.io: #{response.body}") end private_class_method :parse_response def self.description "Upload your app to [Appetize.io](https://appetize.io/) to stream it in browser" end def self.details [ "If you provide a `public_key`, this will overwrite an existing application. If you want to have this build as a new app version, you shouldn't provide this value.", "", "To integrate appetize into your GitHub workflow check out the [device_grid guide](https://github.com/fastlane/fastlane/blob/master/fastlane/lib/fastlane/actions/device_grid/README.md)." ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :api_host, env_name: "APPETIZE_API_HOST", description: "Appetize API host", default_value: 'api.appetize.io', verify_block: proc do |value| UI.user_error!("API host should not contain the scheme e.g. `https`") if value.start_with?('https') end), FastlaneCore::ConfigItem.new(key: :api_token, env_name: "APPETIZE_API_TOKEN", sensitive: true, description: "Appetize.io API Token", verify_block: proc do |value| UI.user_error!("No API Token for Appetize.io given, pass using `api_token: 'token'`") unless value.to_s.length > 0 end), FastlaneCore::ConfigItem.new(key: :url, env_name: "APPETIZE_URL", description: "URL from which the ipa file can be fetched. Alternative to :path", optional: true), FastlaneCore::ConfigItem.new(key: :platform, env_name: "APPETIZE_PLATFORM", description: "Platform. Either `ios` or `android`", default_value: 'ios'), FastlaneCore::ConfigItem.new(key: :path, env_name: "APPETIZE_FILE_PATH", description: "Path to zipped build on the local filesystem. Either this or `url` must be specified", optional: true), FastlaneCore::ConfigItem.new(key: :public_key, env_name: "APPETIZE_PUBLICKEY", description: "If not provided, a new app will be created. If provided, the existing build will be overwritten", optional: true, verify_block: proc do |value| if value.start_with?("private_") UI.user_error!("You provided a private key to appetize, please provide the public key") end end), FastlaneCore::ConfigItem.new(key: :note, env_name: "APPETIZE_NOTE", description: "Notes you wish to add to the uploaded app", optional: true), FastlaneCore::ConfigItem.new(key: :timeout, env_name: "APPETIZE_TIMEOUT", description: "The number of seconds to wait until automatically ending the session due to user inactivity. Must be 30, 60, 90, 120, 180, 300, 600, 1800, 3600 or 7200. Default is 120", type: Integer, optional: true, verify_block: proc do |value| UI.user_error!("The value provided doesn't match any of the supported options.") unless [30, 60, 90, 120, 180, 300, 600, 1800, 3600, 7200].include?(value) end) ] end def self.output [ ['APPETIZE_API_HOST', 'Appetize API host.'], ['APPETIZE_PUBLIC_KEY', 'a public identifier for your app. Use this to update your app after it has been initially created.'], ['APPETIZE_APP_URL', 'a page to test and share your app.'], ['APPETIZE_MANAGE_URL', 'a page to manage your app.'] ] end def self.authors ["klundberg", "giginet", "steprescott"] end def self.category :beta end def self.example_code [ 'appetize( path: "./MyApp.zip", api_token: "yourapitoken", # get it from https://appetize.io/docs#request-api-token public_key: "your_public_key" # get it from https://appetize.io/dashboard )', 'appetize( path: "./MyApp.zip", api_host: "company.appetize.io", # only needed for enterprise hosted solution api_token: "yourapitoken", # get it from https://appetize.io/docs#request-api-token public_key: "your_public_key" # get it from https://appetize.io/dashboard )' ] end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb
fastlane/lib/fastlane/actions/get_ipa_info_plist_value.rb
module Fastlane module Actions module SharedValues GET_IPA_INFO_PLIST_VALUE_CUSTOM_VALUE = :GET_IPA_INFO_PLIST_VALUE_CUSTOM_VALUE end class GetIpaInfoPlistValueAction < Action def self.run(params) ipa = File.expand_path(params[:ipa]) key = params[:key] plist = FastlaneCore::IpaFileAnalyser.fetch_info_plist_file(ipa) value = plist[key] Actions.lane_context[SharedValues::GET_IPA_INFO_PLIST_VALUE_CUSTOM_VALUE] = value return value rescue => ex UI.error(ex) UI.error("Unable to find plist file at '#{ipa}'") end ##################################################### # @!group Documentation ##################################################### def self.description "Returns a value from Info.plist inside a .ipa file" end def self.details "This is useful for introspecting Info.plist files for `.ipa` files that have already been built." end def self.available_options [ FastlaneCore::ConfigItem.new(key: :key, env_name: "FL_GET_IPA_INFO_PLIST_VALUE_KEY", description: "Name of parameter", optional: false), FastlaneCore::ConfigItem.new(key: :ipa, env_name: "FL_GET_IPA_INFO_PLIST_VALUE_IPA", description: "Path to IPA", default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH], default_value_dynamic: true) ] end def self.output [ ['GET_IPA_INFO_PLIST_VALUE_CUSTOM_VALUE', 'The value of the last plist file that was parsed'] ] end def self.return_value "Returns the value in the .ipa's Info.plist corresponding to the passed in Key" end def self.authors ["johnboiles"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'get_ipa_info_plist_value(ipa: "path.ipa", key: "KEY_YOU_READ")' ] end def self.return_type :string end def self.category :project end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/capture_screenshots.rb
fastlane/lib/fastlane/actions/capture_screenshots.rb
module Fastlane module Actions require 'fastlane/actions/capture_ios_screenshots' class CaptureScreenshotsAction < CaptureIosScreenshotsAction ##################################################### # @!group Documentation ##################################################### def self.description "Alias for the `capture_ios_screenshots` action" end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/google_play_track_version_codes.rb
fastlane/lib/fastlane/actions/google_play_track_version_codes.rb
module Fastlane module Actions class GooglePlayTrackVersionCodesAction < Action # Supply::Options.available_options keys that apply to this action. OPTIONS = [ :package_name, :track, :key, :issuer, :json_key, :json_key_data, :root_url, :timeout ] def self.run(params) require 'supply' require 'supply/options' require 'supply/reader' Supply.config = params # AndroidpublisherV3 returns version codes as array of strings # even though version codes need to be integers # https://github.com/fastlane/fastlane/issues/15622 version_codes = Supply::Reader.new.track_version_codes || [] return version_codes.compact.map(&:to_i) end ##################################################### # @!group Documentation ##################################################### def self.description "Retrieves version codes for a Google Play track" end def self.details "More information: [https://docs.fastlane.tools/actions/supply/](https://docs.fastlane.tools/actions/supply/)" end def self.available_options require 'supply' require 'supply/options' Supply::Options.available_options.select do |option| OPTIONS.include?(option.key) end end def self.output end def self.return_value "Array of integers representing the version codes for the given Google Play track" end def self.authors ["panthomakos"] end def self.is_supported?(platform) platform == :android end def self.example_code [ 'google_play_track_version_codes' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/testfairy.rb
fastlane/lib/fastlane/actions/testfairy.rb
module Fastlane module Actions module SharedValues TESTFAIRY_BUILD_URL = :TESTFAIRY_BUILD_URL TESTFAIRY_DOWNLOAD_URL = :TESTFAIRY_DOWNLOAD_URL TESTFAIRY_LANDING_PAGE = :TESTFAIRY_LANDING_PAGE end class TestfairyAction < Action def self.upload_build(upload_url, ipa, options, timeout) require 'faraday' require 'faraday_middleware' UI.success("Uploading to #{upload_url}...") connection = Faraday.new(url: upload_url) do |builder| builder.request(:multipart) builder.request(:url_encoded) builder.request(:retry, max: 3, interval: 5) builder.response(:json, content_type: /\bjson$/) builder.use(FaradayMiddleware::FollowRedirects) builder.adapter(:net_http) end options[:file] = Faraday::UploadIO.new(ipa, 'application/octet-stream') if ipa && File.exist?(ipa) symbols_file = options.delete(:symbols_file) if symbols_file options[:symbols_file] = Faraday::UploadIO.new(symbols_file, 'application/octet-stream') end begin connection.post do |req| req.options.timeout = timeout req.url("/api/upload/") req.body = options end rescue Faraday::TimeoutError UI.crash!("Uploading build to TestFairy timed out ⏳") end end def self.run(params) UI.success('Starting with ipa upload to TestFairy...') metrics_to_client = lambda do |metrics| metrics.map do |metric| case metric when :cpu, :memory, :network, :gps, :battery, :mic, :wifi metric.to_s when :phone_signal 'phone-signal' else UI.user_error!("Unknown metric: #{metric}") end end end options_to_client = lambda do |options| options.map do |option| case option.to_sym when :shake, :anonymous option.to_s when :video_only_wifi 'video-only-wifi' else UI.user_error!("Unknown option: #{option}") end end end # Rejecting key `upload_url` and `timeout` as we don't need it in options client_options = Hash[params.values.reject do |key, value| [:upload_url, :timeout].include?(key) end.map do |key, value| case key when :api_key [key, value] when :ipa [key, value] when :apk [key, value] when :symbols_file [key, value] when :testers_groups [key, value.join(',')] when :metrics [key, metrics_to_client.call(value).join(',')] when :comment [key, value] when :auto_update ['auto-update', value] when :notify [key, value] when :options [key, options_to_client.call(value).join(',')] when :custom [key, value] when :tags [key, value.join(',')] when :folder_name [key, value] when :landing_page_mode [key, value] when :upload_to_saucelabs [key, value] when :platform [key, value] else UI.user_error!("Unknown parameter: #{key}") end end] path = params[:ipa] || params[:apk] UI.user_error!("No ipa or apk were given") unless path return path if Helper.test? response = self.upload_build(params[:upload_url], path, client_options, params[:timeout]) if parse_response(response) UI.success("Build URL: #{Actions.lane_context[SharedValues::TESTFAIRY_BUILD_URL]}") UI.success("Download URL: #{Actions.lane_context[SharedValues::TESTFAIRY_DOWNLOAD_URL]}") UI.success("Landing Page URL: #{Actions.lane_context[SharedValues::TESTFAIRY_LANDING_PAGE]}") UI.success("Build successfully uploaded to TestFairy.") else UI.user_error!("Error when trying to upload ipa to TestFairy") end end ##################################################### # @!group Documentation ##################################################### def self.parse_response(response) if response.body && response.body.key?('status') && response.body['status'] == 'ok' build_url = response.body['build_url'] app_url = response.body['app_url'] landing_page_url = response.body['landing_page_url'] Actions.lane_context[SharedValues::TESTFAIRY_BUILD_URL] = build_url Actions.lane_context[SharedValues::TESTFAIRY_DOWNLOAD_URL] = app_url Actions.lane_context[SharedValues::TESTFAIRY_LANDING_PAGE] = landing_page_url return true else UI.error("Error uploading to TestFairy: #{response.body}") return false end end private_class_method :parse_response def self.description 'Upload a new build to SauceLabs\' TestFairy' end def self.details <<~DETAILS Upload a new build to [TestFairy](https://saucelabs.com/products/mobile-testing/app-betas). You can retrieve your API key on [your settings page](https://app.testfairy.com/settings/access-key) DETAILS end def self.available_options [ # required FastlaneCore::ConfigItem.new(key: :api_key, env_name: "FL_TESTFAIRY_API_KEY", # The name of the environment variable description: "API Key for TestFairy", # a short description of this parameter sensitive: true, verify_block: proc do |value| UI.user_error!("No API key for TestFairy given, pass using `api_key: 'key'`") unless value.to_s.length > 0 end), FastlaneCore::ConfigItem.new(key: :ipa, env_name: 'TESTFAIRY_IPA_PATH', description: 'Path to your IPA file for iOS', default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH], default_value_dynamic: true, optional: true, conflicting_options: [:apk], verify_block: proc do |value| UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :apk, env_name: 'TESTFAIRY_APK_PATH', description: 'Path to your APK file for Android', default_value: Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], default_value_dynamic: true, optional: true, conflicting_options: [:ipa], verify_block: proc do |value| UI.user_error!("Couldn't find apk file at path '#{value}'") unless File.exist?(value) end), # optional FastlaneCore::ConfigItem.new(key: :symbols_file, optional: true, env_name: "FL_TESTFAIRY_SYMBOLS_FILE", description: "Symbols mapping file", default_value: Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH], default_value_dynamic: true, verify_block: proc do |value| UI.user_error!("Couldn't find dSYM file at path '#{value}'") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :upload_url, env_name: "FL_TESTFAIRY_UPLOAD_URL", # The name of the environment variable description: "API URL for TestFairy", # a short description of this parameter default_value: "https://upload.testfairy.com", optional: true), FastlaneCore::ConfigItem.new(key: :testers_groups, optional: true, type: Array, short_option: '-g', env_name: "FL_TESTFAIRY_TESTERS_GROUPS", description: "Array of tester groups to be notified", default_value: []), # the default value is an empty list FastlaneCore::ConfigItem.new(key: :metrics, optional: true, type: Array, env_name: "FL_TESTFAIRY_METRICS", description: "Array of metrics to record (cpu,memory,network,phone_signal,gps,battery,mic,wifi)", default_value: []), # max-duration # video # video-quality # video-rate FastlaneCore::ConfigItem.new(key: :comment, optional: true, env_name: "FL_TESTFAIRY_COMMENT", description: "Additional release notes for this upload. This text will be added to email notifications", default_value: 'No comment provided'), # the default value if the user didn't provide one FastlaneCore::ConfigItem.new(key: :auto_update, optional: true, env_name: "FL_TESTFAIRY_AUTO_UPDATE", description: "Allows an easy upgrade of all users to the current version. To enable set to 'on'", default_value: 'off'), # not well documented FastlaneCore::ConfigItem.new(key: :notify, optional: true, env_name: "FL_TESTFAIRY_NOTIFY", description: "Send email to testers", default_value: 'off'), FastlaneCore::ConfigItem.new(key: :options, optional: true, type: Array, env_name: "FL_TESTFAIRY_OPTIONS", description: "Array of options (shake,video_only_wifi,anonymous)", default_value: []), FastlaneCore::ConfigItem.new(key: :custom, optional: true, env_name: "FL_TESTFAIRY_CUSTOM", description: "Array of custom options. Contact support for more information", default_value: ''), FastlaneCore::ConfigItem.new(key: :timeout, env_name: "FL_TESTFAIRY_TIMEOUT", description: "Request timeout in seconds", type: Integer, optional: true), FastlaneCore::ConfigItem.new(key: :tags, optional: true, env_name: "FL_TESTFAIRY_TAGS", description: "Custom tags that can be used to organize your builds", type: Array, default_value: []), FastlaneCore::ConfigItem.new(key: :folder_name, optional: true, env_name: "FL_TESTFAIRY_FOLDER_NAME", description: "Name of the dashboard folder that contains this app", default_value: ''), FastlaneCore::ConfigItem.new(key: :landing_page_mode, optional: true, env_name: "FL_TESTFAIRY_LANDING_PAGE_MODE", description: "Visibility of build landing after upload. Can be 'open' or 'closed'", default_value: 'open', verify_block: proc do |value| UI.user_error!("The landing page mode can only be open or closed") unless %w(open closed).include?(value) end), FastlaneCore::ConfigItem.new(key: :upload_to_saucelabs, optional: true, env_name: "FL_TESTFAIRY_UPLOAD_TO_SAUCELABS", description: "Upload file directly to Sauce Labs. It can be 'on' or 'off'", default_value: 'off', verify_block: proc do |value| UI.user_error!("The upload to Sauce Labs can only be on or off") unless %w(on off).include?(value) end), FastlaneCore::ConfigItem.new(key: :platform, optional: true, env_name: "FL_TESTFAIRY_PLATFORM", description: "Use if upload build is not iOS or Android. Contact support for more information", default_value: '') ] end def self.example_code [ 'testfairy( api_key: "...", ipa: "./ipa_file.ipa", comment: "Build #{lane_context[SharedValues::BUILD_NUMBER]}", )', 'testfairy( api_key: "...", apk: "../build/app/outputs/apk/qa/release/app-qa-release.apk", comment: "Build #{lane_context[SharedValues::BUILD_NUMBER]}", )' ] end def self.category :beta end def self.output [ ['TESTFAIRY_BUILD_URL', 'URL for the sessions of the newly uploaded build'], ['TESTFAIRY_DOWNLOAD_URL', 'URL directly to the newly uploaded build'], ['TESTFAIRY_LANDING_PAGE', 'URL of the build\'s landing page'] ] end def self.authors ["taka0125", "tcurdt", "vijaysharm", "cdm2012"] end def self.is_supported?(platform) [:ios, :android].include?(platform) end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/cocoapods.rb
fastlane/lib/fastlane/actions/cocoapods.rb
module Fastlane module Actions class CocoapodsAction < Action # rubocop:disable Metrics/PerceivedComplexity def self.run(params) Actions.verify_gem!('cocoapods') cmd = [] unless params[:podfile].nil? if params[:podfile].end_with?('Podfile') podfile_folder = File.dirname(params[:podfile]) else podfile_folder = params[:podfile] end cmd << ["cd '#{podfile_folder}' &&"] end cmd << ['bundle exec'] if use_bundle_exec?(params) cmd << ['pod install'] cmd << '--no-clean' unless params[:clean] cmd << '--no-integrate' unless params[:integrate] cmd << '--clean-install' if params[:clean_install] && pod_version_at_least("1.7", params) cmd << '--allow-root' if params[:allow_root] && pod_version_at_least("1.10", params) cmd << '--repo-update' if params[:repo_update] cmd << '--silent' if params[:silent] cmd << '--verbose' if params[:verbose] cmd << '--no-ansi' unless params[:ansi] cmd << '--deployment' if params[:deployment] Actions.sh(cmd.join(' '), error_callback: lambda { |result| if !params[:repo_update] && params[:try_repo_update_on_error] cmd << '--repo-update' Actions.sh(cmd.join(' '), error_callback: lambda { |retry_result| call_error_callback(params, retry_result) }) else call_error_callback(params, result) end }) end def self.use_bundle_exec?(params) params[:use_bundle_exec] && shell_out_should_use_bundle_exec? end def self.pod_version(params) use_bundle_exec?(params) ? `bundle exec pod --version` : `pod --version` end def self.pod_version_at_least(at_least_version, params) version = pod_version(params) return Gem::Version.new(version) >= Gem::Version.new(at_least_version) end def self.call_error_callback(params, result) if params[:error_callback] Dir.chdir(FastlaneCore::FastlaneFolder.path) do params[:error_callback].call(result) end else UI.shell_error!(result) end end def self.description "Runs `pod install` for the project" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :repo_update, env_name: "FL_COCOAPODS_REPO_UPDATE", description: "Add `--repo-update` flag to `pod install` command", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :clean_install, env_name: "FL_COCOAPODS_CLEAN_INSTALL", description: "Execute a full pod installation ignoring the content of the project cache", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :silent, env_name: "FL_COCOAPODS_SILENT", description: "Execute command without logging output", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :verbose, env_name: "FL_COCOAPODS_VERBOSE", description: "Show more debugging information", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :ansi, env_name: "FL_COCOAPODS_ANSI", description: "Show output with ANSI codes", type: Boolean, default_value: true), FastlaneCore::ConfigItem.new(key: :use_bundle_exec, env_name: "FL_COCOAPODS_USE_BUNDLE_EXEC", description: "Use bundle exec when there is a Gemfile presented", type: Boolean, default_value: true), FastlaneCore::ConfigItem.new(key: :podfile, env_name: "FL_COCOAPODS_PODFILE", description: "Explicitly specify the path to the Cocoapods' Podfile. You can either set it to the Podfile's path or to the folder containing the Podfile file", optional: true, verify_block: proc do |value| UI.user_error!("Could not find Podfile") unless File.exist?(value) || Helper.test? end), FastlaneCore::ConfigItem.new(key: :error_callback, description: 'A callback invoked with the command output if there is a non-zero exit status', optional: true, type: :string_callback), FastlaneCore::ConfigItem.new(key: :try_repo_update_on_error, env_name: "FL_COCOAPODS_TRY_REPO_UPDATE_ON_ERROR", description: 'Retry with --repo-update if action was finished with error', optional: true, default_value: false, type: Boolean), FastlaneCore::ConfigItem.new(key: :deployment, env_name: "FL_COCOAPODS_DEPLOYMENT", description: 'Disallow any changes to the Podfile or the Podfile.lock during installation', optional: true, default_value: false, type: Boolean), FastlaneCore::ConfigItem.new(key: :allow_root, env_name: "FL_COCOAPODS_ALLOW_ROOT", description: 'Allows CocoaPods to run as root', optional: true, default_value: false, type: Boolean), # Deprecated FastlaneCore::ConfigItem.new(key: :clean, env_name: "FL_COCOAPODS_CLEAN", description: "(Option renamed as clean_install) Remove SCM directories", deprecated: true, type: Boolean, default_value: true), FastlaneCore::ConfigItem.new(key: :integrate, env_name: "FL_COCOAPODS_INTEGRATE", description: "(Option removed from cocoapods) Integrate the Pods libraries into the Xcode project(s)", deprecated: true, type: Boolean, default_value: true) ] # Please don't add a version parameter to the `cocoapods` action. If you need to specify a version when running # `cocoapods`, please start using a Gemfile and lock the version there # More information https://docs.fastlane.tools/getting-started/ios/setup/#use-a-gemfile end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.authors ["KrauseFx", "tadpol", "birmacher", "Liquidsoul"] end def self.details "If you use [CocoaPods](http://cocoapods.org) you can use the `cocoapods` integration to run `pod install` before building your app." end def self.example_code [ 'cocoapods', 'cocoapods( clean_install: true, podfile: "./CustomPodfile" )' ] end def self.category :building end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/git_tag_exists.rb
fastlane/lib/fastlane/actions/git_tag_exists.rb
module Fastlane module Actions class GitTagExistsAction < Action def self.run(params) tag_ref = "refs/tags/#{params[:tag].shellescape}" if params[:remote] command = "git ls-remote -q --exit-code #{params[:remote_name].shellescape} #{tag_ref}" else command = "git rev-parse -q --verify #{tag_ref}" end exists = true Actions.sh( command, log: FastlaneCore::Globals.verbose?, error_callback: ->(result) { exists = false } ) exists end ##################################################### # @!group Documentation ##################################################### def self.description "Checks if the git tag with the given name exists in the current repo" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :tag, description: "The tag name that should be checked"), FastlaneCore::ConfigItem.new(key: :remote, description: "Whether to check remote. Defaults to `false`", type: Boolean, default_value: false, optional: true), FastlaneCore::ConfigItem.new(key: :remote_name, description: "The remote to check. Defaults to `origin`", default_value: 'origin', optional: true) ] end def self.return_value "Boolean value whether the tag exists or not" end def self.return_type :bool end def self.output [ ] end def self.authors ["antondomashnev"] end def self.is_supported?(platform) true end def self.example_code [ 'if git_tag_exists(tag: "1.1.0") UI.message("Found it 🚀") end' ] end def self.category :source_control end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/hg_commit_version_bump.rb
fastlane/lib/fastlane/actions/hg_commit_version_bump.rb
module Fastlane module Actions # Commits version bump. class HgCommitVersionBumpAction < Action def self.run(params) require 'xcodeproj' require 'pathname' require 'set' require 'shellwords' xcodeproj_path = params[:xcodeproj] ? File.expand_path(File.join('.', params[:xcodeproj])) : nil if Helper.test? xcodeproj_path = "/tmp/Test.xcodeproj" end # get the repo root path repo_path = Helper.test? ? '/tmp/repo' : Actions.sh('hg root').strip repo_pathname = Pathname.new(repo_path) if xcodeproj_path # ensure that the xcodeproj passed in was OK unless Helper.test? UI.user_error!("Could not find the specified xcodeproj: #{xcodeproj_path}") unless File.directory?(xcodeproj_path) end else # find an xcodeproj (ignoring dependencies) xcodeproj_paths = Fastlane::Helper::XcodeprojHelper.find(repo_path) # no projects found: error UI.user_error!('Could not find a .xcodeproj in the current repository\'s working directory.') if xcodeproj_paths.count == 0 # too many projects found: error if xcodeproj_paths.count > 1 relative_projects = xcodeproj_paths.map { |e| Pathname.new(e).relative_path_from(repo_pathname).to_s }.join("\n") UI.user_error!("Found multiple .xcodeproj projects in the current repository's working directory. Please specify your app's main project: \n#{relative_projects}") end # one project found: great xcodeproj_path = xcodeproj_paths.first end # find the pbxproj path, relative to hg directory if Helper.test? hg_dirty_files = params[:test_dirty_files].split(",") expected_changed_files = params[:test_expected_files].split(",") else pbxproj_pathname = Pathname.new(File.join(xcodeproj_path, 'project.pbxproj')) pbxproj_path = pbxproj_pathname.relative_path_from(repo_pathname).to_s # find the info_plist files project = Xcodeproj::Project.open(xcodeproj_path) info_plist_files = project.objects.select do |object| object.isa == 'XCBuildConfiguration' end.map(&:to_hash).map do |object_hash| object_hash['buildSettings'] end.select do |build_settings| build_settings.key?('INFOPLIST_FILE') end.map do |build_settings| build_settings['INFOPLIST_FILE'] end.uniq.map do |info_plist_path| Pathname.new(File.expand_path(File.join(xcodeproj_path, '..', info_plist_path))).relative_path_from(repo_pathname).to_s end # create our list of files that we expect to have changed, they should all be relative to the project root, which should be equal to the hg workdir root expected_changed_files = [] expected_changed_files << pbxproj_path expected_changed_files << info_plist_files expected_changed_files.flatten!.uniq! # get the list of files that have actually changed in our hg workdir hg_dirty_files = Actions.sh('hg status -n').split("\n") end # little user hint UI.user_error!("No file changes picked up. Make sure you run the `increment_build_number` action first.") if hg_dirty_files.empty? # check if the files changed are the ones we expected to change (these should be only the files that have version info in them) dirty_set = Set.new(hg_dirty_files.map(&:downcase)) expected_set = Set.new(expected_changed_files.map(&:downcase)) changed_files_as_expected = dirty_set.subset?(expected_set) unless changed_files_as_expected unless params[:force] str = ["Found unexpected uncommitted changes in the working directory. Expected these files to have changed:", "#{expected_changed_files.join("\n")}.", "But found these actual changes: \n#{hg_dirty_files.join("\n")}.", "Make sure you have cleaned up the build artifacts and are only left with the changed version files at this", "stage in your lane, and don't touch the working directory while your lane is running. You can also use the :force option to ", "bypass this check, and always commit a version bump regardless of the state of the working directory."].join("\n") UI.user_error!(str) end end # create a commit with a message command = "hg commit -m '#{params[:message]}'" return command if Helper.test? begin Actions.sh(command) UI.success("Committed \"#{params[:message]}\" 💾.") rescue => ex UI.error(ex) UI.important("Didn't commit any changes. 😐") end end def self.description "This will commit a version bump to the hg repo" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :message, env_name: "FL_COMMIT_BUMP_MESSAGE", description: "The commit message when committing the version bump", default_value: "Version Bump"), FastlaneCore::ConfigItem.new(key: :xcodeproj, env_name: "FL_BUILD_NUMBER_PROJECT", description: "The path to your project file (Not the workspace). If you have only one, this is optional", optional: true, verify_block: proc do |value| UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with?(".xcworkspace") UI.user_error!("Could not find Xcode project") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :force, env_name: "FL_FORCE_COMMIT", description: "Forces the commit, even if other files than the ones containing the version number have been modified", optional: true, default_value: false, type: Boolean), FastlaneCore::ConfigItem.new(key: :test_dirty_files, env_name: "FL_HG_COMMIT_TEST_DIRTY_FILES", description: "A list of dirty files passed in for testing", optional: true, default_value: "file1, file2"), FastlaneCore::ConfigItem.new(key: :test_expected_files, env_name: "FL_HG_COMMIT_TEST_EXP_FILES", description: "A list of expected changed files passed in for testing", optional: true, default_value: "file1, file2") ] end def self.author # credits to lmirosevic for original git version "sjrmanning" end def self.is_supported?(platform) true end def self.details list = <<-LIST.markdown_list All `.plist` files The `.xcodeproj/project.pbxproj` file LIST [ "The mercurial equivalent of the [commit_version_bump](https://docs.fastlane.tools/actions/commit_version_bump/) git action. Like the git version, it is useful in conjunction with [`increment_build_number`](https://docs.fastlane.tools/actions/increment_build_number/).", "It checks the repo to make sure that only the relevant files have changed, these are the files that `increment_build_number` (`agvtool`) touches:".markdown_preserve_newlines, list, "Then commits those files to the repo.", "Customize the message with the `:message` option, defaults to 'Version Bump'", "If you have other uncommitted changes in your repo, this action will fail. If you started off in a clean repo, and used the _ipa_ and or _sigh_ actions, then you can use the [clean_build_artifacts](https://docs.fastlane.tools/actions/clean_build_artifacts/) action to clean those temporary files up before running this action." ].join("\n") end def self.example_code [ 'hg_commit_version_bump', 'hg_commit_version_bump( message: "Version Bump", # create a commit with a custom message xcodeproj: "./path/MyProject.xcodeproj", # optional, if you have multiple Xcode project files, you must specify your main project here )' ] end def self.category :source_control end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/xcode_select.rb
fastlane/lib/fastlane/actions/xcode_select.rb
module Fastlane module Actions # See: https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/xcode-select.1.html # # DESCRIPTION # xcode-select controls the location of the developer directory used by xcrun(1), xcodebuild(1), cc(1), # and other Xcode and BSD development tools. This also controls the locations that are searched for by # man(1) for developer tool manpages. # # DEVELOPER_DIR # Overrides the active developer directory. When DEVELOPER_DIR is set, its value will be used # instead of the system-wide active developer directory. # # Note that for historical reason, the developer directory is considered to be the Developer content # directory inside the Xcode application (for example /Applications/Xcode.app/Contents/Developer). # You can set the environment variable to either the actual Developer contents directory, or the # Xcode application directory -- the xcode-select provided shims will automatically convert the # environment variable into the full Developer content path. # class XcodeSelectAction < Action def self.run(params) params = nil unless params.kind_of?(Array) xcode_path = (params || []).first # Verify that a param was passed in UI.user_error!("Path to Xcode application required (e.g. `xcode_select(\"/Applications/Xcode.app\")`)") unless xcode_path.to_s.length > 0 # Verify that a path to a directory was passed in UI.user_error!("Path '#{xcode_path}' doesn't exist") unless Dir.exist?(xcode_path) UI.message("Setting Xcode version to #{xcode_path} for all build steps") ENV["DEVELOPER_DIR"] = File.join(xcode_path, "/Contents/Developer") end def self.description "Change the xcode-path to use. Useful for beta versions of Xcode" end def self.details [ "Select and build with the Xcode installed at the provided path.", "Use the `xcodes` action if you want to select an Xcode:", "- Based on a version specifier or", "- You don't have known, stable paths, as may happen in a CI environment." ].join("\n") end def self.author "dtrenz" end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'xcode_select("/Applications/Xcode-8.3.2.app")' ] end def self.category :building end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/ensure_env_vars.rb
fastlane/lib/fastlane/actions/ensure_env_vars.rb
module Fastlane module Actions class EnsureEnvVarsAction < Action def self.run(params) variables = params[:env_vars] missing_variables = variables.select { |variable| ENV[variable].to_s.strip.empty? } UI.user_error!("Missing environment variable(s) '#{missing_variables.join('\', \'')}'") unless missing_variables.empty? is_one = variables.length == 1 UI.success("Environment variable#{is_one ? '' : 's'} '#{variables.join('\', \'')}' #{is_one ? 'is' : 'are'} set!") end def self.description 'Raises an exception if the specified env vars are not set' end def self.details 'This action will check if some environment variables are set.' end def self.available_options [ FastlaneCore::ConfigItem.new(key: :env_vars, description: 'The environment variables names that should be checked', type: Array, verify_block: proc do |value| UI.user_error!('Specify at least one environment variable name') if value.empty? end) ] end def self.authors ['revolter'] end def self.example_code [ 'ensure_env_vars( env_vars: [\'GITHUB_USER_NAME\', \'GITHUB_API_TOKEN\'] )' ] end def self.category :misc end def self.is_supported?(platform) true end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/download_from_play_store.rb
fastlane/lib/fastlane/actions/download_from_play_store.rb
module Fastlane module Actions class DownloadFromPlayStoreAction < Action def self.run(params) require 'supply' require 'supply/options' Supply.config = params # we already have the finished config require 'supply/setup' Supply::Setup.new.perform_download end ##################################################### # @!group Documentation ##################################################### def self.description "Download metadata and binaries from Google Play (via _supply_)" end def self.details "More information: https://docs.fastlane.tools/actions/download_from_play_store/" end def self.available_options require 'supply' require 'supply/options' options = Supply::Options.available_options.clone # remove all the unnecessary (for this action) options options_to_keep = [:package_name, :version_name, :track, :metadata_path, :json_key, :json_key_data, :root_url, :timeout, :key, :issuer] options.delete_if { |option| options_to_keep.include?(option.key) == false } end def self.output end def self.return_value end def self.authors ["janpio"] end def self.is_supported?(platform) platform == :android end def self.example_code [ 'download_from_play_store' ] end def self.category :production end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/hg_push.rb
fastlane/lib/fastlane/actions/hg_push.rb
module Fastlane module Actions # Pushes commits to the remote hg repo class HgPushAction < Action def self.run(params) command = ['hg', 'push'] command << '--force' if params[:force] command << params[:destination] unless params[:destination].empty? return command.join(' ') if Helper.test? Actions.sh(command.join(' ')) UI.success('Successfully pushed changes to remote 🚀.') end def self.description "This will push changes to the remote hg repository" end def self.details "The mercurial equivalent of [push_to_git_remote](https://docs.fastlane.tools/actions/push_to_git_remote/). Pushes your local commits to a remote mercurial repo. Useful when local changes such as adding a version bump commit or adding a tag are part of your lane’s actions." end def self.available_options [ FastlaneCore::ConfigItem.new(key: :force, env_name: "FL_HG_PUSH_FORCE", description: "Force push to remote", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :destination, env_name: "FL_HG_PUSH_DESTINATION", description: "The destination to push to", default_value: '', optional: true) ] end def self.author # credits to lmirosevic for original git version "sjrmanning" end def self.is_supported?(platform) true end def self.example_code [ 'hg_push', 'hg_push( destination: "ssh://hg@repohost.com/owner/repo", force: true )' ] end def self.category :source_control end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/upload_to_testflight.rb
fastlane/lib/fastlane/actions/upload_to_testflight.rb
module Fastlane module Actions class UploadToTestflightAction < Action def self.run(values) require 'pilot' require 'pilot/options' distribute_only = values[:distribute_only] changelog = Actions.lane_context[SharedValues::FL_CHANGELOG] values[:changelog] ||= changelog if changelog unless distribute_only values[:ipa] ||= Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] values[:ipa] = File.expand_path(values[:ipa]) if values[:ipa] values[:pkg] ||= Actions.lane_context[SharedValues::PKG_OUTPUT_PATH] values[:pkg] = File.expand_path(values[:pkg]) if values[:pkg] end # Only set :api_key from SharedValues if :api_key_path isn't set (conflicting options) unless values[:api_key_path] values[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY] end return values if Helper.test? if distribute_only build_manager = Pilot::BuildManager.new build_manager.start(values, should_login: true) build_manager.wait_for_build_processing_to_be_complete(false) unless values[:skip_waiting_for_build_processing] build_manager.distribute(values) # we already have the finished config else Pilot::BuildManager.new.upload(values) # we already have the finished config end end ##################################################### # @!group Documentation ##################################################### def self.description "Upload new binary to App Store Connect for TestFlight beta testing (via _pilot_)" end def self.details [ "More details can be found on https://docs.fastlane.tools/actions/pilot/.", "This integration will only do the TestFlight upload." ].join("\n") end def self.available_options require "pilot" require "pilot/options" FastlaneCore::CommanderGenerator.new.generate(Pilot::Options.available_options) end def self.example_code [ 'upload_to_testflight', 'testflight # alias for "upload_to_testflight"', 'pilot # alias for "upload_to_testflight"', 'upload_to_testflight(skip_submission: true) # to only upload the build', 'upload_to_testflight( username: "felix@krausefx.com", app_identifier: "com.krausefx.app", itc_provider: "abcde12345" # pass a specific value to the iTMSTransporter -itc_provider option )', 'upload_to_testflight( beta_app_feedback_email: "email@email.com", beta_app_description: "This is a description of my app", demo_account_required: true, notify_external_testers: false, changelog: "This is my changelog of things that have changed in a log" )', 'upload_to_testflight( beta_app_review_info: { contact_email: "email@email.com", contact_first_name: "Connect", contact_last_name: "API", contact_phone: "5558675309", demo_account_name: "demo@email.com", demo_account_password: "connectapi", notes: "this is review note for the reviewer <3 thank you for reviewing" }, localized_app_info: { "default": { feedback_email: "default@email.com", marketing_url: "https://example.com/marketing-default", privacy_policy_url: "https://example.com/privacy-default", description: "Default description", }, "en-GB": { feedback_email: "en-gb@email.com", marketing_url: "https://example.com/marketing-en-gb", privacy_policy_url: "https://example.com/privacy-en-gb", description: "en-gb description", } }, localized_build_info: { "default": { whats_new: "Default changelog", }, "en-GB": { whats_new: "en-gb changelog", } } )' ] end def self.category :beta end def self.authors ["KrauseFx"] end def self.is_supported?(platform) [:ios, :mac, :tvos].include?(platform) end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/sonar.rb
fastlane/lib/fastlane/actions/sonar.rb
module Fastlane module Actions class SonarAction < Action def self.run(params) verify_sonar_scanner_binary command_prefix = [ 'cd', File.expand_path('.').shellescape, '&&' ].join(' ') sonar_scanner_args = [] sonar_scanner_args << "-Dproject.settings=\"#{params[:project_configuration_path]}\"" if params[:project_configuration_path] sonar_scanner_args << "-Dsonar.projectKey=\"#{params[:project_key]}\"" if params[:project_key] sonar_scanner_args << "-Dsonar.projectName=\"#{params[:project_name]}\"" if params[:project_name] sonar_scanner_args << "-Dsonar.projectVersion=\"#{params[:project_version]}\"" if params[:project_version] sonar_scanner_args << "-Dsonar.sources=\"#{params[:sources_path]}\"" if params[:sources_path] sonar_scanner_args << "-Dsonar.exclusions=\"#{params[:exclusions]}\"" if params[:exclusions] sonar_scanner_args << "-Dsonar.language=\"#{params[:project_language]}\"" if params[:project_language] sonar_scanner_args << "-Dsonar.sourceEncoding=\"#{params[:source_encoding]}\"" if params[:source_encoding] sonar_scanner_args << "-Dsonar.login=\"#{params[:sonar_login]}\"" if params[:sonar_login] sonar_scanner_args << "-Dsonar.token=\"#{params[:sonar_token]}\"" if params[:sonar_token] sonar_scanner_args << "-Dsonar.host.url=\"#{params[:sonar_url]}\"" if params[:sonar_url] sonar_scanner_args << "-Dsonar.organization=\"#{params[:sonar_organization]}\"" if params[:sonar_organization] sonar_scanner_args << "-Dsonar.branch.name=\"#{params[:branch_name]}\"" if params[:branch_name] sonar_scanner_args << "-Dsonar.pullrequest.branch=\"#{params[:pull_request_branch]}\"" if params[:pull_request_branch] sonar_scanner_args << "-Dsonar.pullrequest.base=\"#{params[:pull_request_base]}\"" if params[:pull_request_base] sonar_scanner_args << "-Dsonar.pullrequest.key=\"#{params[:pull_request_key]}\"" if params[:pull_request_key] sonar_scanner_args << params[:sonar_runner_args] if params[:sonar_runner_args] command = [ command_prefix, 'sonar-scanner', sonar_scanner_args ].join(' ') # hide command, as it may contain credentials Fastlane::Actions.sh_control_output(command, print_command: false, print_command_output: true) end def self.verify_sonar_scanner_binary UI.user_error!("You have to install sonar-scanner using `brew install sonar-scanner`") unless `which sonar-scanner`.to_s.length > 0 end ##################################################### # @!group Documentation ##################################################### def self.description "Invokes sonar-scanner to programmatically run SonarQube analysis" end def self.details [ "See [http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner](http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner) for details.", "It can process unit test results if formatted as junit report as shown in [xctest](https://docs.fastlane.tools/actions/xctest/) action. It can also integrate coverage reports in Cobertura format, which can be transformed into by the [slather](https://docs.fastlane.tools/actions/slather/) action." ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :project_configuration_path, env_name: "FL_SONAR_RUNNER_PROPERTIES_PATH", description: "The path to your sonar project configuration file; defaults to `sonar-project.properties`", # default is enforced by sonar-scanner binary optional: true, verify_block: proc do |value| UI.user_error!("Couldn't find file at path '#{value}'") unless value.nil? || File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :project_key, env_name: "FL_SONAR_RUNNER_PROJECT_KEY", description: "The key sonar uses to identify the project, e.g. `name.gretzki.awesomeApp`. Must either be specified here or inside the sonar project configuration file", optional: true), FastlaneCore::ConfigItem.new(key: :project_name, env_name: "FL_SONAR_RUNNER_PROJECT_NAME", description: "The name of the project that gets displayed on the sonar report page. Must either be specified here or inside the sonar project configuration file", optional: true), FastlaneCore::ConfigItem.new(key: :project_version, env_name: "FL_SONAR_RUNNER_PROJECT_VERSION", description: "The project's version that gets displayed on the sonar report page. Must either be specified here or inside the sonar project configuration file", optional: true), FastlaneCore::ConfigItem.new(key: :sources_path, env_name: "FL_SONAR_RUNNER_SOURCES_PATH", description: "Comma-separated paths to directories containing source files. Must either be specified here or inside the sonar project configuration file", optional: true), FastlaneCore::ConfigItem.new(key: :exclusions, env_name: "FL_SONAR_RUNNER_EXCLUSIONS", description: "Comma-separated paths to directories to be excluded from the analysis", optional: true), FastlaneCore::ConfigItem.new(key: :project_language, env_name: "FL_SONAR_RUNNER_PROJECT_LANGUAGE", description: "Language key, e.g. objc", optional: true), FastlaneCore::ConfigItem.new(key: :source_encoding, env_name: "FL_SONAR_RUNNER_SOURCE_ENCODING", description: "Used encoding of source files, e.g., UTF-8", optional: true), FastlaneCore::ConfigItem.new(key: :sonar_runner_args, env_name: "FL_SONAR_RUNNER_ARGS", description: "Pass additional arguments to sonar-scanner. Be sure to provide the arguments with a leading `-D` e.g. FL_SONAR_RUNNER_ARGS=\"-Dsonar.verbose=true\"", optional: true), FastlaneCore::ConfigItem.new(key: :sonar_login, env_name: "FL_SONAR_LOGIN", description: "Pass the Sonar Login Token (e.g: xxxxxxprivate_token_XXXXbXX7e)", deprecated: "Login and password were deprecated in favor of login token. See https://community.sonarsource.com/t/deprecating-sonar-login-and-sonar-password-in-favor-of-sonar-token/95829 for more details", optional: true, sensitive: true, conflicting_options: [:sonar_token]), FastlaneCore::ConfigItem.new(key: :sonar_token, env_name: "FL_SONAR_TOKEN", description: "Pass the Sonar Token (e.g: xxxxxxprivate_token_XXXXbXX7e)", optional: true, sensitive: true, conflicting_options: [:sonar_login]), FastlaneCore::ConfigItem.new(key: :sonar_url, env_name: "FL_SONAR_URL", description: "Pass the url of the Sonar server", optional: true), FastlaneCore::ConfigItem.new(key: :sonar_organization, env_name: "FL_SONAR_ORGANIZATION", description: "Key of the organization on SonarCloud", optional: true), FastlaneCore::ConfigItem.new(key: :branch_name, env_name: "FL_SONAR_RUNNER_BRANCH_NAME", description: "Pass the branch name which is getting scanned", optional: true), FastlaneCore::ConfigItem.new(key: :pull_request_branch, env_name: "FL_SONAR_RUNNER_PULL_REQUEST_BRANCH", description: "The name of the branch that contains the changes to be merged", optional: true), FastlaneCore::ConfigItem.new(key: :pull_request_base, env_name: "FL_SONAR_RUNNER_PULL_REQUEST_BASE", description: "The long-lived branch into which the PR will be merged", optional: true), FastlaneCore::ConfigItem.new(key: :pull_request_key, env_name: "FL_SONAR_RUNNER_PULL_REQUEST_KEY", description: "Unique identifier of your PR. Must correspond to the key of the PR in GitHub or TFS", optional: true) ] end def self.return_value "The exit code of the sonar-scanner binary" end def self.authors ["c_gretzki"] end def self.is_supported?(platform) true end def self.example_code [ 'sonar( project_key: "name.gretzki.awesomeApp", project_version: "1.0", project_name: "iOS - AwesomeApp", sources_path: File.expand_path("../AwesomeApp") )', 'sonar( project_key: "name.gretzki.awesomeApp", project_version: "1.0", project_name: "iOS - AwesomeApp", sources_path: File.expand_path("../AwesomeApp"), sonar_organization: "myOrg", sonar_token: "123456abcdef", sonar_url: "https://sonarcloud.io" )' ] end def self.category :testing end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/swiftlint.rb
fastlane/lib/fastlane/actions/swiftlint.rb
module Fastlane module Actions class SwiftlintAction < Action def self.run(params) if `which swiftlint`.to_s.length == 0 && params[:executable].nil? && !Helper.test? UI.user_error!("You have to install swiftlint using `brew install swiftlint` or specify the executable path with the `:executable` option.") end version = swiftlint_version(executable: params[:executable]) if params[:mode] == :autocorrect && version < Gem::Version.new('0.5.0') && !Helper.test? UI.user_error!("Your version of swiftlint (#{version}) does not support autocorrect mode.\nUpdate swiftlint using `brew update && brew upgrade swiftlint`") end # See 'Breaking' section release notes here: https://github.com/realm/SwiftLint/releases/tag/0.43.0 if params[:mode] == :autocorrect && version >= Gem::Version.new('0.43.0') UI.deprecated("Your version of swiftlint (#{version}) has deprecated autocorrect mode, please start using fix mode in input param") UI.important("For now, switching swiftlint mode `from :autocorrect to :fix` for you 😇") params[:mode] = :fix elsif params[:mode] == :fix && version < Gem::Version.new('0.43.0') UI.important("Your version of swiftlint (#{version}) does not support fix mode.\nUpdate swiftlint using `brew update && brew upgrade swiftlint`") UI.important("For now, switching swiftlint mode `from :fix to :autocorrect` for you 😇") params[:mode] = :autocorrect end mode_format = params[:mode] == :fix ? "--" : "" command = (params[:executable] || "swiftlint").dup command << " #{mode_format}#{params[:mode]}" command << optional_flags(params) if params[:files] if version < Gem::Version.new('0.5.1') UI.user_error!("Your version of swiftlint (#{version}) does not support list of files as input.\nUpdate swiftlint using `brew update && brew upgrade swiftlint`") end files = params[:files].map.with_index(0) { |f, i| "SCRIPT_INPUT_FILE_#{i}=#{f.shellescape}" }.join(" ") command = command.prepend("SCRIPT_INPUT_FILE_COUNT=#{params[:files].count} #{files} ") command << " --use-script-input-files" end command << " > #{params[:output_file].shellescape}" if params[:output_file] begin Actions.sh(command) rescue handle_swiftlint_error(params[:ignore_exit_status], $?.exitstatus) raise if params[:raise_if_swiftlint_error] end end def self.optional_flags(params) command = "" command << " --path #{params[:path].shellescape}" if params[:path] command << supported_option_switch(params, :strict, "0.9.2", true) command << " --config #{params[:config_file].shellescape}" if params[:config_file] command << " --reporter #{params[:reporter]}" if params[:reporter] command << supported_option_switch(params, :quiet, "0.9.0", true) command << supported_option_switch(params, :format, "0.11.0", true) if params[:mode] == :autocorrect command << supported_no_cache_option(params) if params[:no_cache] command << " --compiler-log-path #{params[:compiler_log_path].shellescape}" if params[:compiler_log_path] return command end # Get current SwiftLint version def self.swiftlint_version(executable: nil) binary = executable || 'swiftlint' Gem::Version.new(`#{binary} version`.chomp) end def self.supported_no_cache_option(params) if [:autocorrect, :fix, :lint].include?(params[:mode]) return " --no-cache" else return "" end end # Return "--option" switch if option is on and current SwiftLint version is greater or equal than min version. # Return "" otherwise. def self.supported_option_switch(params, option, min_version, can_ignore = false) return "" unless params[option] version = swiftlint_version(executable: params[:executable]) if version < Gem::Version.new(min_version) message = "Your version of swiftlint (#{version}) does not support '--#{option}' option.\nUpdate swiftlint to #{min_version} or above using `brew update && brew upgrade swiftlint`" message += "\nThe option will be ignored." if can_ignore can_ignore ? UI.important(message) : UI.user_error!(message) "" else " --#{option}" end end ##################################################### # @!group Documentation ##################################################### def self.description "Run swift code validation using SwiftLint" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :mode, env_name: "FL_SWIFTLINT_MODE", description: "SwiftLint mode: :lint, :fix, :autocorrect or :analyze", type: Symbol, default_value: :lint, optional: true), FastlaneCore::ConfigItem.new(key: :path, env_name: "FL_SWIFTLINT_PATH", description: "Specify path to lint", optional: true, verify_block: proc do |value| UI.user_error!("Couldn't find path '#{File.expand_path(value)}'") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :output_file, env_name: "FL_SWIFTLINT_OUTPUT_FILE", description: 'Path to output SwiftLint result', optional: true), FastlaneCore::ConfigItem.new(key: :config_file, env_name: "FL_SWIFTLINT_CONFIG_FILE", description: 'Custom configuration file of SwiftLint', optional: true), FastlaneCore::ConfigItem.new(key: :strict, env_name: "FL_SWIFTLINT_STRICT", description: 'Fail on warnings? (true/false)', default_value: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :files, env_name: "FL_SWIFTLINT_FILES", description: 'List of files to process', type: Array, optional: true), FastlaneCore::ConfigItem.new(key: :ignore_exit_status, env_name: "FL_SWIFTLINT_IGNORE_EXIT_STATUS", description: "Ignore the exit status of the SwiftLint command, so that serious violations \ don't fail the build (true/false)", default_value: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :raise_if_swiftlint_error, env_name: "FL_SWIFTLINT_RAISE_IF_SWIFTLINT_ERROR", description: "Raises an error if swiftlint fails, so you can fail CI/CD jobs if necessary \ (true/false)", default_value: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :reporter, env_name: "FL_SWIFTLINT_REPORTER", description: "Choose output reporter. Available: xcode, json, csv, checkstyle, codeclimate, \ junit, html, emoji, sonarqube, markdown, github-actions-logging", optional: true, verify_block: proc do |value| available = ['xcode', 'json', 'csv', 'checkstyle', 'codeclimate', 'junit', 'html', 'emoji', 'sonarqube', 'markdown', 'github-actions-logging'] UI.important("Known 'reporter' values are '#{available.join("', '")}'. If you're receiving errors from swiftlint related to the reporter, make sure the reporter identifier you're using is correct and it's supported by your version of swiftlint.") unless available.include?(value) end), FastlaneCore::ConfigItem.new(key: :quiet, env_name: "FL_SWIFTLINT_QUIET", description: "Don't print status logs like 'Linting <file>' & 'Done linting'", default_value: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :executable, env_name: "FL_SWIFTLINT_EXECUTABLE", description: "Path to the `swiftlint` executable on your machine", optional: true), FastlaneCore::ConfigItem.new(key: :format, env_name: "FL_SWIFTLINT_FORMAT", description: "Format code when mode is :autocorrect", default_value: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :no_cache, env_name: "FL_SWIFTLINT_NO_CACHE", description: "Ignore the cache when mode is :autocorrect or :lint", default_value: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :compiler_log_path, env_name: "FL_SWIFTLINT_COMPILER_LOG_PATH", description: "Compiler log path when mode is :analyze", optional: true, verify_block: proc do |value| UI.user_error!("Couldn't find compiler_log_path '#{File.expand_path(value)}'") unless File.exist?(value) end) ] end def self.output end def self.return_value end def self.authors ["KrauseFx"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'swiftlint( mode: :lint, # SwiftLint mode: :lint (default) or :autocorrect path: "/path/to/lint", # Specify path to lint (optional) output_file: "swiftlint.result.json", # The path of the output file (optional) config_file: ".swiftlint-ci.yml", # The path of the configuration file (optional) files: [ # List of files to process (optional) "AppDelegate.swift", "path/to/project/Model.swift" ], raise_if_swiftlint_error: true, # Allow fastlane to raise an error if swiftlint fails ignore_exit_status: true # Allow fastlane to continue even if SwiftLint returns a non-zero exit status )' ] end def self.category :testing end def self.handle_swiftlint_error(ignore_exit_status, exit_status) if ignore_exit_status failure_suffix = 'which would normally fail the build.' secondary_message = 'fastlane will continue because the `ignore_exit_status` option was used! 🙈' else failure_suffix = 'which represents a failure.' secondary_message = 'If you want fastlane to continue anyway, use the `ignore_exit_status` option. 🙈' end UI.important("") UI.important("SwiftLint finished with exit code #{exit_status}, #{failure_suffix}") UI.important(secondary_message) UI.important("") UI.user_error!("SwiftLint finished with errors (exit code: #{exit_status})") unless ignore_exit_status end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/dotgpg_environment.rb
fastlane/lib/fastlane/actions/dotgpg_environment.rb
module Fastlane module Actions module SharedValues end class DotgpgEnvironmentAction < Action def self.run(options) Actions.verify_gem!('dotgpg') require 'dotgpg/environment' UI.message("Reading secrets from #{options[:dotgpg_file]}") Dotgpg::Environment.new(options[:dotgpg_file]).apply end def self.description "Reads in production secrets set in a dotgpg file and puts them in ENV" end def self.details "More information about dotgpg can be found at [https://github.com/ConradIrwin/dotgpg](https://github.com/ConradIrwin/dotgpg)." end def self.available_options [ FastlaneCore::ConfigItem.new(key: :dotgpg_file, env_name: "DOTGPG_FILE", description: "Path to your gpg file", code_gen_sensitive: true, default_value: Dir["dotgpg/*.gpg"].last, default_value_dynamic: true, optional: false, verify_block: proc do |value| UI.user_error!("Dotgpg file '#{File.expand_path(value)}' not found") unless File.exist?(value) end) ] end def self.authors ["simonlevy5"] end def self.example_code [ "dotgpg_environment(dotgpg_file: './path/to/gpgfile')" ] end def self.category :misc end def self.is_supported?(platform) true end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/changelog_from_git_commits.rb
fastlane/lib/fastlane/actions/changelog_from_git_commits.rb
module Fastlane module Actions module SharedValues FL_CHANGELOG ||= :FL_CHANGELOG end class ChangelogFromGitCommitsAction < Action def self.run(params) if params[:commits_count] UI.success("Collecting the last #{params[:commits_count]} Git commits") else if params[:between] if params[:between].kind_of?(String) && params[:between].include?(",") # :between is string from, to = params[:between].split(",", 2) elsif params[:between].kind_of?(Array) from, to = params[:between] end else from = Actions.last_git_tag_name(params[:match_lightweight_tag], params[:tag_match_pattern]) UI.verbose("Found the last Git tag: #{from}") to = 'HEAD' end UI.success("Collecting Git commits between #{from} and #{to}") end # Normally it is not good practice to take arbitrary input and convert it to a symbol # because prior to Ruby 2.2, symbols are never garbage collected. However, we've # already validated that the input matches one of our allowed values, so this is OK merge_commit_filtering = params[:merge_commit_filtering].to_sym # We want to be specific and exclude nil for this comparison if params[:include_merges] == false merge_commit_filtering = :exclude_merges end params[:path] = './' unless params[:path] Dir.chdir(params[:path]) do if params[:commits_count] changelog = Actions.git_log_last_commits(params[:pretty], params[:commits_count], merge_commit_filtering, params[:date_format], params[:ancestry_path], params[:app_path]) else changelog = Actions.git_log_between(params[:pretty], from, to, merge_commit_filtering, params[:date_format], params[:ancestry_path], params[:app_path]) end changelog = changelog.gsub("\n\n", "\n") if changelog # as there are duplicate newlines Actions.lane_context[SharedValues::FL_CHANGELOG] = changelog if params[:quiet] == false puts("") puts(changelog) puts("") end changelog end end ##################################################### # @!group Documentation ##################################################### def self.description "Collect git commit messages into a changelog" end def self.details "By default, messages will be collected back to the last tag, but the range can be controlled" end def self.output [ ['FL_CHANGELOG', 'The changelog string generated from the collected git commit messages'] ] end def self.available_options [ FastlaneCore::ConfigItem.new(key: :between, env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_BETWEEN', description: 'Array containing two Git revision values between which to collect messages, you mustn\'t use it with :commits_count key at the same time', optional: true, type: Array, # allow Array, String both conflicting_options: [:commits_count], verify_block: proc do |value| UI.user_error!(":between must not contain nil values") if value.any?(&:nil?) UI.user_error!(":between must be an array of size 2") unless (value || []).size == 2 end), FastlaneCore::ConfigItem.new(key: :commits_count, env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_COUNT', description: 'Number of commits to include in changelog, you mustn\'t use it with :between key at the same time', optional: true, conflicting_options: [:between], type: Integer, verify_block: proc do |value| UI.user_error!(":commits_count must be >= 1") unless value.to_i >= 1 end), FastlaneCore::ConfigItem.new(key: :path, env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_PATH', description: 'Path of the git repository', optional: true, default_value: './'), FastlaneCore::ConfigItem.new(key: :pretty, env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_PRETTY', description: 'The format applied to each commit while generating the collected value', optional: true, default_value: '%B'), FastlaneCore::ConfigItem.new(key: :date_format, env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_DATE_FORMAT', description: 'The date format applied to each commit while generating the collected value', optional: true), FastlaneCore::ConfigItem.new(key: :ancestry_path, env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_ANCESTRY_PATH', description: 'Whether or not to use ancestry-path param', optional: true, default_value: false, type: Boolean), FastlaneCore::ConfigItem.new(key: :tag_match_pattern, env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_TAG_MATCH_PATTERN', description: 'A glob(7) pattern to match against when finding the last git tag', optional: true), FastlaneCore::ConfigItem.new(key: :match_lightweight_tag, env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_MATCH_LIGHTWEIGHT_TAG', description: 'Whether or not to match a lightweight tag when searching for the last one', optional: true, default_value: true, type: Boolean), FastlaneCore::ConfigItem.new(key: :quiet, env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_TAG_QUIET', description: 'Whether or not to disable changelog output', optional: true, default_value: false, type: Boolean), FastlaneCore::ConfigItem.new(key: :include_merges, deprecated: "Use `:merge_commit_filtering` instead", env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_INCLUDE_MERGES', description: "Whether or not to include any commits that are merges", optional: true, type: Boolean, verify_block: proc do |value| UI.important("The :include_merges option is deprecated. Please use :merge_commit_filtering instead") unless value.nil? end), FastlaneCore::ConfigItem.new(key: :merge_commit_filtering, env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_MERGE_COMMIT_FILTERING', description: "Controls inclusion of merge commits when collecting the changelog. Valid values: #{GIT_MERGE_COMMIT_FILTERING_OPTIONS.map { |o| "'#{o}'" }.join(', ')}", optional: true, default_value: 'include_merges', verify_block: proc do |value| matches_option = GIT_MERGE_COMMIT_FILTERING_OPTIONS.any? { |opt| opt.to_s == value } UI.user_error!("Valid values for :merge_commit_filtering are #{GIT_MERGE_COMMIT_FILTERING_OPTIONS.map { |o| "'#{o}'" }.join(', ')}") unless matches_option end), FastlaneCore::ConfigItem.new(key: :app_path, env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_APP_PATH', description: "Scopes the changelog to a specific subdirectory of the repository", optional: true) ] end def self.return_value "Returns a String containing your formatted git commits" end def self.return_type :string end def self.author ['mfurtak', 'asfalcone', 'SiarheiFedartsou', 'allewun'] end def self.is_supported?(platform) true end def self.example_code [ 'changelog_from_git_commits', 'changelog_from_git_commits( between: ["7b092b3", "HEAD"], # Optional, lets you specify a revision/tag range between which to collect commit info pretty: "- (%ae) %s", # Optional, lets you provide a custom format to apply to each commit when generating the changelog text date_format: "short", # Optional, lets you provide an additional date format to dates within the pretty-formatted string match_lightweight_tag: false, # Optional, lets you ignore lightweight (non-annotated) tags when searching for the last tag merge_commit_filtering: "exclude_merges" # Optional, lets you filter out merge commits )' ] end def self.category :source_control end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/match_nuke.rb
fastlane/lib/fastlane/actions/match_nuke.rb
module Fastlane module Actions class MatchNukeAction < Action def self.run(params) require 'match' params.load_configuration_file("Matchfile") params[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY] cert_type = Match.cert_type_sym(params[:type]) UI.important("Going to revoke your '#{cert_type}' certificate type and provisioning profiles") Match::Nuke.new.run(params, type: cert_type) end ##################################################### # @!group Documentation ##################################################### def self.description "Easily nuke your certificate and provisioning profiles (via _match_)" end def self.details [ "Use the match_nuke action to revoke your certificates and provisioning profiles.", "Don't worry, apps that are already available in the App Store / TestFlight will still work.", "Builds distributed via Ad Hoc or Enterprise will be disabled after nuking your account, so you'll have to re-upload a new build.", "After clearing your account you'll start from a clean state, and you can run match to generate your certificates and profiles again.", "More information: https://docs.fastlane.tools/actions/match/" ].join("\n") end def self.available_options require 'match' Match::Options.available_options end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'match_nuke(type: "development")', # See all other options https://github.com/fastlane/fastlane/blob/master/match/lib/match/module.rb#L23 'match_nuke(type: "development", api_key: app_store_connect_api_key)' ] end def self.authors ["crazymanish"] end def self.category :code_signing end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/dsym_zip.rb
fastlane/lib/fastlane/actions/dsym_zip.rb
require 'plist' module Fastlane module Actions module SharedValues DSYM_ZIP_PATH = :DSYM_ZIP_PATH end class DsymZipAction < Action def self.run(params) archive = params[:archive_path] params[:dsym_path] ||= File.join("#{File.basename(archive, '.*')}.app.dSYM.zip") dsym_folder_path = File.expand_path(File.join(archive, 'dSYMs')) zipped_dsym_path = File.expand_path(params[:dsym_path]) Actions.lane_context[SharedValues::DSYM_ZIP_PATH] = zipped_dsym_path if params[:all] Actions.sh(%(cd "#{dsym_folder_path}" && zip -r "#{zipped_dsym_path}" "#{dsym_folder_path}"/*.dSYM)) else plist = Plist.parse_xml(File.join(archive, 'Info.plist')) app_name = Helper.test? ? 'MyApp.app' : File.basename(plist['ApplicationProperties']['ApplicationPath']) dsym_name = "#{app_name}.dSYM" Actions.sh(%(cd "#{dsym_folder_path}" && zip -r "#{zipped_dsym_path}" "#{dsym_name}")) end end ##################################################### # @!group Documentation ##################################################### def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.description 'Creates a zipped dSYM in the project root from the .xcarchive' end def self.details "You can manually specify the path to the xcarchive (not needed if you use `xcodebuild`/`xcarchive` to build your archive)" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :archive_path, description: 'Path to your xcarchive file. Optional if you use the `xcodebuild` action', default_value: Actions.lane_context[SharedValues::XCODEBUILD_ARCHIVE], default_value_dynamic: true, optional: true, env_name: 'DSYM_ZIP_XCARCHIVE_PATH', verify_block: proc do |value| UI.user_error!("Couldn't find xcarchive file at path '#{value}'") if !Helper.test? && !File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :dsym_path, description: 'Path for generated dsym. Optional, default is your apps root directory', optional: true, env_name: 'DSYM_ZIP_DSYM_PATH'), FastlaneCore::ConfigItem.new(key: :all, description: 'Whether or not all dSYM files are to be included. Optional, default is false in which only your app dSYM is included', default_value: false, optional: true, type: Boolean, env_name: 'DSYM_ZIP_ALL') ] end def self.output [ ['DSYM_ZIP_PATH', 'The named of the zipped dSYM'] ] end def self.author 'lmirosevic' end def self.example_code [ 'dsym_zip', 'dsym_zip( archive_path: "MyApp.xcarchive" )' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb
fastlane/lib/fastlane/actions/latest_testflight_build_number.rb
require 'credentials_manager' module Fastlane module Actions module SharedValues LATEST_TESTFLIGHT_BUILD_NUMBER = :LATEST_TESTFLIGHT_BUILD_NUMBER LATEST_TESTFLIGHT_VERSION = :LATEST_TESTFLIGHT_VERSION end class LatestTestflightBuildNumberAction < Action def self.run(params) build_v, build_nr = AppStoreBuildNumberAction.get_build_version_and_number(params) Actions.lane_context[SharedValues::LATEST_TESTFLIGHT_BUILD_NUMBER] = build_nr Actions.lane_context[SharedValues::LATEST_TESTFLIGHT_VERSION] = build_v return build_nr end ##################################################### # @!group Documentation ##################################################### def self.description "Fetches most recent build number from TestFlight" end def self.details [ "Provides a way to have `increment_build_number` be based on the latest build you uploaded to iTC.", "Fetches the most recent build number from TestFlight based on the version number. Provides a way to have `increment_build_number` be based on the latest build you uploaded to iTC." ].join("\n") end def self.available_options user = CredentialsManager::AppfileConfig.try_fetch_value(:itunes_connect_id) user ||= CredentialsManager::AppfileConfig.try_fetch_value(:apple_id) [ FastlaneCore::ConfigItem.new(key: :api_key_path, env_names: ["APPSTORE_BUILD_NUMBER_API_KEY_PATH", "APP_STORE_CONNECT_API_KEY_PATH"], description: "Path to your App Store Connect API Key JSON file (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-json-file)", optional: true, conflicting_options: [:api_key], verify_block: proc do |value| UI.user_error!("Couldn't find API key JSON file at path '#{value}'") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :api_key, env_names: ["APPSTORE_BUILD_NUMBER_API_KEY", "APP_STORE_CONNECT_API_KEY"], description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#using-fastlane-api-key-hash-option)", type: Hash, optional: true, sensitive: true, conflicting_options: [:api_key_path]), FastlaneCore::ConfigItem.new(key: :live, short_option: "-l", env_name: "CURRENT_BUILD_NUMBER_LIVE", description: "Query the live version (ready-for-sale)", optional: true, type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :app_identifier, short_option: "-a", env_name: "FASTLANE_APP_IDENTIFIER", description: "The bundle identifier of your app", code_gen_sensitive: true, default_value: CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier), default_value_dynamic: true), FastlaneCore::ConfigItem.new(key: :username, short_option: "-u", env_name: "ITUNESCONNECT_USER", description: "Your Apple ID Username", optional: true, default_value: user, default_value_dynamic: true), FastlaneCore::ConfigItem.new(key: :version, env_name: "LATEST_VERSION", description: "The version number whose latest build number we want", optional: true), FastlaneCore::ConfigItem.new(key: :platform, short_option: "-j", env_name: "APPSTORE_PLATFORM", description: "The platform to use (optional)", optional: true, default_value: "ios", verify_block: proc do |value| UI.user_error!("The platform can only be ios, osx, xros or appletvos/tvos") unless %w(ios osx xros appletvos tvos).include?(value) end), FastlaneCore::ConfigItem.new(key: :initial_build_number, env_name: "INITIAL_BUILD_NUMBER", description: "sets the build number to given value if no build is in current train", default_value: 1, skip_type_validation: true), # allow Integer, String FastlaneCore::ConfigItem.new(key: :team_id, short_option: "-k", env_name: "LATEST_TESTFLIGHT_BUILD_NUMBER_TEAM_ID", description: "The ID of your App Store Connect team if you're in multiple teams", optional: true, skip_type_validation: true, # allow Integer, String code_gen_sensitive: true, default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_id), default_value_dynamic: true), FastlaneCore::ConfigItem.new(key: :team_name, short_option: "-e", env_name: "LATEST_TESTFLIGHT_BUILD_NUMBER_TEAM_NAME", description: "The name of your App Store Connect team if you're in multiple teams", optional: true, code_gen_sensitive: true, default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_name), default_value_dynamic: true) ] end def self.output [ ['LATEST_TESTFLIGHT_BUILD_NUMBER', 'The latest build number of the latest version of the app uploaded to TestFlight'], ['LATEST_TESTFLIGHT_VERSION', 'The version of the latest build number'] ] end def self.return_value "Integer representation of the latest build number uploaded to TestFlight" end def self.return_type :int end def self.authors ["daveanderson"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'latest_testflight_build_number(version: "1.3")', 'increment_build_number({ build_number: latest_testflight_build_number + 1 })' ] end def self.sample_return_value 2 end def self.category :app_store_connect end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/team_name.rb
fastlane/lib/fastlane/actions/team_name.rb
module Fastlane module Actions module SharedValues end class TeamNameAction < Action def self.run(params) params = nil unless params.kind_of?(Array) team = (params || []).first UI.user_error!("Please pass your Team Name (e.g. team_name 'Felix Krause')") unless team.to_s.length > 0 UI.message("Setting Team Name to '#{team}' for all build steps") [:FASTLANE_TEAM_NAME, :PRODUCE_TEAM_NAME].each do |current| ENV[current.to_s] = team end end def self.description "Set a team to use by its name" end def self.author "KrauseFx" end def self.is_supported?(platform) platform == :ios end def self.example_code [ 'team_name("Felix Krause")' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/ipa.rb
fastlane/lib/fastlane/actions/ipa.rb
# rubocop:disable Lint/AssignmentInCondition module Fastlane module Actions module SharedValues IPA_OUTPUT_PATH ||= :IPA_OUTPUT_PATH # originally defined in BuildIosAppAction DSYM_OUTPUT_PATH ||= :DSYM_OUTPUT_PATH # originally defined in BuildIosAppAction end ARGS_MAP = { workspace: '-w', project: '-p', configuration: '-c', scheme: '-s', clean: '--clean', archive: '--archive', destination: '-d', embed: '-m', identity: '-i', sdk: '--sdk', ipa: '--ipa', xcconfig: '--xcconfig', xcargs: '--xcargs' } class IpaAction < Action def self.is_supported?(platform) platform == :ios end def self.run(params) Actions.verify_gem!('krausefx-shenzhen') # The output directory of the IPA and dSYM absolute_dest_directory = nil # Used to get the final path of the IPA and dSYM if dest = params[:destination] absolute_dest_directory = File.expand_path(dest) end # The args we will build with # Maps nice developer build parameters to Shenzhen args build_args = params_to_build_args(params) unless params[:scheme] UI.important("You haven't specified a scheme. This might cause problems. If you can't see any output, please pass a `scheme`") end # If no dest directory given, default to current directory absolute_dest_directory ||= Dir.pwd if Helper.test? Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] = File.join(absolute_dest_directory, 'test.ipa') Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH] = File.join(absolute_dest_directory, 'test.app.dSYM.zip') return build_args end # Joins args into space delimited string build_args = build_args.join(' ') core_command = "krausefx-ipa build #{build_args} --verbose | xcpretty" command = "set -o pipefail && #{core_command}" UI.verbose(command) begin Actions.sh(command) # Finds absolute path of IPA and dSYM absolute_ipa_path = find_ipa_file(absolute_dest_directory) absolute_dsym_path = find_dsym_file(absolute_dest_directory) # Sets shared values to use after this action is performed Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] = absolute_ipa_path Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH] = absolute_dsym_path ENV[SharedValues::IPA_OUTPUT_PATH.to_s] = absolute_ipa_path # for deliver ENV[SharedValues::DSYM_OUTPUT_PATH.to_s] = absolute_dsym_path deprecation_warning rescue => ex [ "-------------------------------------------------------", "Original Error:", " => " + ex.to_s, "A build error occurred. You are using legacy `shenzhen` for building", "it is recommended to upgrade to _gym_: ", "https://docs.fastlane.tools/actions/gym/", core_command, "-------------------------------------------------------" ].each do |txt| UI.error(txt) end # Raise a custom exception, as the normal one is useless for the user UI.user_error!("A build error occurred, this is usually related to code signing. Take a look at the error above") end end def self.params_to_build_args(config) params = config.values params = params.delete_if { |k, v| v.nil? } params = fill_in_default_values(params) # Maps nice developer param names to Shenzhen's `ipa build` arguments params.collect do |k, v| v ||= '' if ARGS_MAP[k] if k == :clean v == true ? '--clean' : '--no-clean' elsif k == :archive v == true ? '--archive' : '--no-archive' else value = (v.to_s.length > 0 ? "\"#{v}\"" : '') "#{ARGS_MAP[k]} #{value}".strip end end end.compact end def self.fill_in_default_values(params) embed = Actions.lane_context[Actions::SharedValues::SIGH_PROFILE_PATH] || ENV["SIGH_PROFILE_PATH"] params[:embed] ||= embed if embed params end def self.find_ipa_file(dir) # Finds last modified .ipa in the destination directory Dir[File.join(dir, '*.ipa')].sort { |a, b| File.mtime(b) <=> File.mtime(a) }.first end def self.find_dsym_file(dir) # Finds last modified .dSYM.zip in the destination directory Dir[File.join(dir, '*.dSYM.zip')].sort { |a, b| File.mtime(b) <=> File.mtime(a) }.first end def self.description "Easily build and sign your app using shenzhen" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :workspace, env_name: "IPA_WORKSPACE", description: "WORKSPACE Workspace (.xcworkspace) file to use to build app (automatically detected in current directory)", optional: true), FastlaneCore::ConfigItem.new(key: :project, env_name: "IPA_PROJECT", description: "Project (.xcodeproj) file to use to build app (automatically detected in current directory, overridden by --workspace option, if passed)", optional: true), FastlaneCore::ConfigItem.new(key: :configuration, env_name: "IPA_CONFIGURATION", description: "Configuration used to build", optional: true), FastlaneCore::ConfigItem.new(key: :scheme, env_name: "IPA_SCHEME", description: "Scheme used to build app", optional: true), FastlaneCore::ConfigItem.new(key: :clean, env_name: "IPA_CLEAN", description: "Clean project before building", optional: true, type: Boolean), FastlaneCore::ConfigItem.new(key: :archive, env_name: "IPA_ARCHIVE", description: "Archive project after building", optional: true, type: Boolean), FastlaneCore::ConfigItem.new(key: :destination, env_name: "IPA_DESTINATION", description: "Build destination. Defaults to current directory", default_value_dynamic: true, optional: true), FastlaneCore::ConfigItem.new(key: :embed, env_name: "IPA_EMBED", description: "Sign .ipa file with .mobileprovision", optional: true), FastlaneCore::ConfigItem.new(key: :identity, env_name: "IPA_IDENTITY", description: "Identity to be used along with --embed", optional: true), FastlaneCore::ConfigItem.new(key: :sdk, env_name: "IPA_SDK", description: "Use SDK as the name or path of the base SDK when building the project", optional: true), FastlaneCore::ConfigItem.new(key: :ipa, env_name: "IPA_IPA", description: "Specify the name of the .ipa file to generate (including file extension)", optional: true), FastlaneCore::ConfigItem.new(key: :xcconfig, env_name: "IPA_XCCONFIG", description: "Use an extra XCCONFIG file to build the app", optional: true), FastlaneCore::ConfigItem.new(key: :xcargs, env_name: "IPA_XCARGS", description: "Pass additional arguments to xcodebuild when building the app. Be sure to quote multiple args", optional: true, type: :shell_string) ] end def self.output [ ['IPA_OUTPUT_PATH', 'The path to the newly generated ipa file'], ['DSYM_OUTPUT_PATH', 'The path to the dsym file'] ] end def self.author "joshdholtz" end def self.example_code [ 'ipa( workspace: "MyApp.xcworkspace", configuration: "Debug", scheme: "MyApp", # (optionals) clean: true, # This means "Do Clean". Cleans project before building (the default if not specified). destination: "path/to/dir", # Destination directory. Defaults to current directory. ipa: "my-app.ipa", # specify the name of the .ipa file to generate (including file extension) xcargs: "MY_ADHOC=0", # pass additional arguments to xcodebuild when building the app. embed: "my.mobileprovision", # Sign .ipa file with .mobileprovision identity: "MyIdentity", # Identity to be used along with --embed sdk: "10.0", # use SDK as the name or path of the base SDK when building the project. archive: true # this means "Do Archive". Archive project after building (the default if not specified). )' ] end def self.category :deprecated end def self.deprecated_notes [ "You are using legacy `shenzhen` to build your app, which will be removed soon!", "It is recommended to upgrade to _gym_.", "To do so, just replace `ipa(...)` with `gym(...)` in your Fastfile.", "To make code signing work, follow [https://docs.fastlane.tools/codesigning/xcode-project/](https://docs.fastlane.tools/codesigning/xcode-project/)." ].join("\n") end end end end # rubocop:enable Lint/AssignmentInCondition
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/create_app_on_managed_play_store.rb
fastlane/lib/fastlane/actions/create_app_on_managed_play_store.rb
require 'google/apis/playcustomapp_v1' require 'supply' module Fastlane module Actions class CreateAppOnManagedPlayStoreAction < Action def self.run(params) client = PlaycustomappClient.make_from_config(params: params) FastlaneCore::PrintTable.print_values( config: params, mask_keys: [:json_key_data], title: "Summary for create_app_on_managed_play_store" ) client.create_app( app_title: params[:app_title], language_code: params[:language], developer_account: params[:developer_account_id], apk_path: params[:apk] ) end def self.description "Create Managed Google Play Apps" end def self.authors ["janpio"] end def self.return_value # If your method provides a return value, you can describe here what it does end def self.details "Create new apps on Managed Google Play." end def self.example_code [ "create_app_on_managed_play_store( json_key: 'path/to/you/json/key/file', developer_account_id: 'developer_account_id', # obtained using the `get_managed_play_store_publishing_rights` action (or looking at the Play Console url) app_title: 'Your app title', language: 'en_US', # primary app language in BCP 47 format apk: '/files/app-release.apk' )" ] end def self.available_options [ # Authorization FastlaneCore::ConfigItem.new(key: :json_key, env_name: "SUPPLY_JSON_KEY", short_option: "-j", conflicting_options: [:json_key_data], optional: true, # optional until it is possible specify either json_key OR json_key_data are required description: "The path to a file containing service account JSON, used to authenticate with Google", code_gen_sensitive: true, default_value: CredentialsManager::AppfileConfig.try_fetch_value(:json_key_file), default_value_dynamic: true, verify_block: proc do |value| UI.user_error!("Could not find service account json file at path '#{File.expand_path(value)}'") unless File.exist?(File.expand_path(value)) UI.user_error!("'#{value}' doesn't seem to be a JSON file") unless FastlaneCore::Helper.json_file?(File.expand_path(value)) end), FastlaneCore::ConfigItem.new(key: :json_key_data, env_name: "SUPPLY_JSON_KEY_DATA", short_option: "-c", conflicting_options: [:json_key], optional: true, description: "The raw service account JSON data used to authenticate with Google", code_gen_sensitive: true, default_value: CredentialsManager::AppfileConfig.try_fetch_value(:json_key_data_raw), default_value_dynamic: true, verify_block: proc do |value| begin JSON.parse(value) rescue JSON::ParserError UI.user_error!("Could not parse service account json: JSON::ParseError") end end), FastlaneCore::ConfigItem.new(key: :developer_account_id, short_option: "-k", env_name: "SUPPLY_DEVELOPER_ACCOUNT_ID", description: "The ID of your Google Play Console account. Can be obtained from the URL when you log in (`https://play.google.com/apps/publish/?account=...` or when you 'Obtain private app publishing rights' (https://developers.google.com/android/work/play/custom-app-api/get-started#retrieve_the_developer_account_id)", code_gen_sensitive: true, default_value: CredentialsManager::AppfileConfig.try_fetch_value(:developer_account_id), default_value_dynamic: true), # APK FastlaneCore::ConfigItem.new(key: :apk, env_name: "SUPPLY_APK", description: "Path to the APK file to upload", short_option: "-b", code_gen_sensitive: true, default_value: Dir["*.apk"].last || Dir[File.join("app", "build", "outputs", "apk", "app-release.apk")].last, default_value_dynamic: true, verify_block: proc do |value| UI.user_error!("No value found for 'apk'") if value.to_s.length == 0 UI.user_error!("Could not find apk file at path '#{value}'") unless File.exist?(value) UI.user_error!("apk file is not an apk") unless value.end_with?('.apk') end), # Title FastlaneCore::ConfigItem.new(key: :app_title, env_name: "SUPPLY_APP_TITLE", short_option: "-q", description: "App Title"), # Language FastlaneCore::ConfigItem.new(key: :language, short_option: "-m", env_name: "SUPPLY_LANGUAGE", description: "Default app language (e.g. 'en_US')", default_value: "en_US", verify_block: proc do |language| unless Supply::Languages::ALL_LANGUAGES.include?(language) UI.user_error!("Please enter one of the available languages: #{Supply::Languages::ALL_LANGUAGES}") end end), # Google Play API FastlaneCore::ConfigItem.new(key: :root_url, env_name: "SUPPLY_ROOT_URL", description: "Root URL for the Google Play API. The provided URL will be used for API calls in place of https://www.googleapis.com/", optional: true, verify_block: proc do |value| UI.user_error!("Could not parse URL '#{value}'") unless value =~ URI.regexp end), FastlaneCore::ConfigItem.new(key: :timeout, env_name: "SUPPLY_TIMEOUT", optional: true, description: "Timeout for read, open, and send (in seconds)", type: Integer, default_value: 300) ] end def self.is_supported?(platform) [:android].include?(platform) end def self.category :misc end end end end require 'supply/client' class PlaycustomappClient < Supply::AbstractGoogleServiceClient SERVICE = Google::Apis::PlaycustomappV1::PlaycustomappService SCOPE = Google::Apis::PlaycustomappV1::AUTH_ANDROIDPUBLISHER ##################################################### # @!group Create ##################################################### def create_app(app_title: nil, language_code: nil, developer_account: nil, apk_path: nil) custom_app = Google::Apis::PlaycustomappV1::CustomApp.new(title: app_title, language_code: language_code) call_google_api do client.create_account_custom_app( developer_account, custom_app, upload_source: apk_path ) end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/slather.rb
fastlane/lib/fastlane/actions/slather.rb
module Fastlane module Actions class SlatherAction < Action # https://github.com/SlatherOrg/slather/blob/v2.4.9/lib/slather/command/coverage_command.rb ARGS_MAP = { travis: '--travis', travis_pro: '--travispro', circleci: '--circleci', jenkins: '--jenkins', buildkite: '--buildkite', teamcity: '--teamcity', github: '--github', coveralls: '--coveralls', simple_output: '--simple-output', gutter_json: '--gutter-json', cobertura_xml: '--cobertura-xml', sonarqube_xml: '--sonarqube-xml', llvm_cov: '--llvm-cov', json: '--json', html: '--html', show: '--show', build_directory: '--build-directory', source_directory: '--source-directory', output_directory: '--output-directory', ignore: '--ignore', verbose: '--verbose', input_format: '--input-format', scheme: '--scheme', configuration: '--configuration', workspace: '--workspace', binary_file: '--binary-file', binary_basename: '--binary-basename', arch: '--arch', source_files: '--source-files', decimals: '--decimals', ymlfile: '--ymlfile' }.freeze def self.run(params) # This will fail if using Bundler. Skip the check rather than needing to # require bundler unless params[:use_bundle_exec] Actions.verify_gem!('slather') end validate_params!(params) command = build_command(params) sh(command) end def self.has_config_file?(params) params[:ymlfile] ? File.file?(params[:ymlfile]) : File.file?('.slather.yml') end def self.slather_version require 'slather' Slather::VERSION end def self.configuration_available? Gem::Version.new('2.4.1') <= Gem::Version.new(slather_version) end def self.ymlfile_available? Gem::Version.new('2.8.0') <= Gem::Version.new(slather_version) end def self.validate_params!(params) if params[:configuration] UI.user_error!('configuration option is available since version 2.4.1') unless configuration_available? end if params[:ymlfile] UI.user_error!('ymlfile option is available since version 2.8.0') unless ymlfile_available? end if params[:proj] || has_config_file?(params) true else UI.user_error!("You have to provide a project with `:proj` or use a .slather.yml") end # for backwards compatibility when :binary_file type was Boolean if params[:binary_file] == true || params[:binary_file] == false params[:binary_file] = nil end # :binary_file validation was skipped for backwards compatibility with Boolean. If a # Boolean was passed in, it has now been removed. Revalidate :binary_file binary_file_options = available_options.find { |a| a.key == :binary_file } binary_file_options.skip_type_validation = false binary_file_options.verify!(params[:binary_file]) end def self.build_command(params) command = [] command.push("bundle exec") if params[:use_bundle_exec] && shell_out_should_use_bundle_exec? command << "slather coverage" ARGS_MAP.each do |key, cli_param| cli_value = params[key] if cli_value if cli_value.kind_of?(TrueClass) command << cli_param elsif cli_value.kind_of?(String) command << cli_param command << cli_value.shellescape elsif cli_value.kind_of?(Array) command << cli_value.map { |path| "#{cli_param} #{path.shellescape}" } end else next end end command << params[:proj].shellescape if params[:proj] command.join(" ") end ##################################################### # @!group Documentation ##################################################### def self.description "Use slather to generate a code coverage report" end def self.details [ "Slather works with multiple code coverage formats, including Xcode 7 code coverage.", "Slather is available at [https://github.com/SlatherOrg/slather](https://github.com/SlatherOrg/slather)." ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :build_directory, env_name: "FL_SLATHER_BUILD_DIRECTORY", # The name of the environment variable description: "The location of the build output", # a short description of this parameter optional: true), FastlaneCore::ConfigItem.new(key: :proj, env_name: "FL_SLATHER_PROJ", # The name of the environment variable description: "The project file that slather looks at", # a short description of this parameter verify_block: proc do |value| UI.user_error!("No project file specified, pass using `proj: 'Project.xcodeproj'`") unless value && !value.empty? end, optional: true), FastlaneCore::ConfigItem.new(key: :workspace, env_name: "FL_SLATHER_WORKSPACE", description: "The workspace that slather looks at", optional: true), FastlaneCore::ConfigItem.new(key: :scheme, env_name: "FL_SLATHER_SCHEME", # The name of the environment variable description: "Scheme to use when calling slather", optional: true), FastlaneCore::ConfigItem.new(key: :configuration, env_name: "FL_SLATHER_CONFIGURATION", # The name of the environment variable description: "Configuration to use when calling slather (since slather-2.4.1)", optional: true), FastlaneCore::ConfigItem.new(key: :input_format, env_name: "FL_SLATHER_INPUT_FORMAT", # The name of the environment variable description: "The input format that slather should look for", optional: true), FastlaneCore::ConfigItem.new(key: :github, env_name: "FL_SLATHER_GITHUB_ENABLED", # The name of the environment variable description: "Tell slather that it is running on GitHub Actions", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :buildkite, env_name: "FL_SLATHER_BUILDKITE_ENABLED", # The name of the environment variable description: "Tell slather that it is running on Buildkite", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :teamcity, env_name: "FL_SLATHER_TEAMCITY_ENABLED", # The name of the environment variable description: "Tell slather that it is running on TeamCity", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :jenkins, env_name: "FL_SLATHER_JENKINS_ENABLED", # The name of the environment variable description: "Tell slather that it is running on Jenkins", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :travis, env_name: "FL_SLATHER_TRAVIS_ENABLED", # The name of the environment variable description: "Tell slather that it is running on TravisCI", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :travis_pro, env_name: "FL_SLATHER_TRAVIS_PRO_ENABLED", # The name of the environment variable description: "Tell slather that it is running on TravisCI Pro", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :circleci, env_name: "FL_SLATHER_CIRCLECI_ENABLED", description: "Tell slather that it is running on CircleCI", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :coveralls, env_name: "FL_SLATHER_COVERALLS_ENABLED", description: "Tell slather that it should post data to Coveralls", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :simple_output, env_name: "FL_SLATHER_SIMPLE_OUTPUT_ENABLED", description: "Tell slather that it should output results to the terminal", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :gutter_json, env_name: "FL_SLATHER_GUTTER_JSON_ENABLED", description: "Tell slather that it should output results as Gutter JSON format", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :cobertura_xml, env_name: "FL_SLATHER_COBERTURA_XML_ENABLED", description: "Tell slather that it should output results as Cobertura XML format", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :sonarqube_xml, env_name: "FL_SLATHER_SONARQUBE_XML_ENABLED", description: "Tell slather that it should output results as SonarQube Generic XML format", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :llvm_cov, env_name: "FL_SLATHER_LLVM_COV_ENABLED", description: "Tell slather that it should output results as llvm-cov show format", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :json, env_name: "FL_SLATHER_JSON_ENABLED", description: "Tell slather that it should output results as static JSON report", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :html, env_name: "FL_SLATHER_HTML_ENABLED", description: "Tell slather that it should output results as static HTML pages", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :show, env_name: "FL_SLATHER_SHOW_ENABLED", description: "Tell slather that it should open static html pages automatically", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :source_directory, env_name: "FL_SLATHER_SOURCE_DIRECTORY", description: "Tell slather the location of your source files", optional: true), FastlaneCore::ConfigItem.new(key: :output_directory, env_name: "FL_SLATHER_OUTPUT_DIRECTORY", description: "Tell slather the location of for your output files", optional: true), FastlaneCore::ConfigItem.new(key: :ignore, env_name: "FL_SLATHER_IGNORE", description: "Tell slather to ignore files matching a path or any path from an array of paths", type: Array, optional: true), FastlaneCore::ConfigItem.new(key: :verbose, env_name: "FL_SLATHER_VERBOSE", description: "Tell slather to enable verbose mode", type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :use_bundle_exec, env_name: "FL_SLATHER_USE_BUNDLE_EXEC", description: "Use bundle exec to execute slather. Make sure it is in the Gemfile", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :binary_basename, env_name: "FL_SLATHER_BINARY_BASENAME", description: "Basename of the binary file, this should match the name of your bundle excluding its extension (i.e. YourApp [for YourApp.app bundle])", type: Array, optional: true), FastlaneCore::ConfigItem.new(key: :binary_file, env_name: "FL_SLATHER_BINARY_FILE", description: "Binary file name to be used for code coverage", type: Array, skip_type_validation: true, # skipping validation for backwards compatibility with Boolean type optional: true), FastlaneCore::ConfigItem.new(key: :arch, env_name: "FL_SLATHER_ARCH", description: "Specify which architecture the binary file is in. Needed for universal binaries", optional: true), FastlaneCore::ConfigItem.new(key: :source_files, env_name: "FL_SLATHER_SOURCE_FILES", description: "A Dir.glob compatible pattern used to limit the lookup to specific source files. Ignored in gcov mode", skip_type_validation: true, # skipping validation for backwards compatibility with Boolean type default_value: false, optional: true), FastlaneCore::ConfigItem.new(key: :decimals, env_name: "FL_SLATHER_DECIMALS", description: "The amount of decimals to use for % coverage reporting", skip_type_validation: true, # allow Integer, String default_value: false, optional: true), FastlaneCore::ConfigItem.new(key: :ymlfile, env_name: "FL_SLATHER_YMLFILE", description: "Relative path to a file used in place of '.slather.yml'", optional: true) ] end def self.output end def self.authors ["mattdelves"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'slather( build_directory: "foo", input_format: "bah", scheme: "MyScheme", proj: "MyProject.xcodeproj" )' ] end def self.category :testing end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/badge.rb
fastlane/lib/fastlane/actions/badge.rb
module Fastlane module Actions class BadgeAction < Action def self.run(params) UI.important('The badge action has been deprecated,') UI.important('please checkout the badge plugin here:') UI.important('https://github.com/HazAT/fastlane-plugin-badge') Actions.verify_gem!('badge') require 'badge' options = { dark: params[:dark], custom: params[:custom], no_badge: params[:no_badge], shield: params[:shield], alpha: params[:alpha], shield_io_timeout: params[:shield_io_timeout], glob: params[:glob], alpha_channel: params[:alpha_channel], shield_gravity: params[:shield_gravity], shield_no_resize: params[:shield_no_resize] } begin Badge::Runner.new.run(params[:path], options) rescue => e # We want to catch this error and raise our own so that we are not counting this as a crash in our metrics UI.verbose(e.backtrace.join("\n")) UI.user_error!("Something went wrong while running badge: #{e}") end end ##################################################### # @!group Documentation ##################################################### def self.description "Automatically add a badge to your app icon" end def self.details [ "Please use the [badge plugin](https://github.com/HazAT/fastlane-plugin-badge) instead.", "This action will add a light/dark badge onto your app icon.", "You can also provide your custom badge/overlay or add a shield for more customization.", "More info: [https://github.com/HazAT/badge](https://github.com/HazAT/badge)", "**Note**: If you want to reset the badge back to default, you can use `sh 'git checkout -- <path>/Assets.xcassets/'`." ].join("\n") end def self.example_code [ 'badge(dark: true)', 'badge(alpha: true)', 'badge(custom: "/Users/xxx/Desktop/badge.png")', 'badge(shield: "Version-0.0.3-blue", no_badge: true)' ] end def self.category :deprecated end def self.available_options [ FastlaneCore::ConfigItem.new(key: :dark, env_name: "FL_BADGE_DARK", description: "Adds a dark flavored badge on top of your icon", optional: true, type: Boolean, verify_block: proc do |value| UI.user_error!("dark is only a flag and should always be true") unless value == true end), FastlaneCore::ConfigItem.new(key: :custom, env_name: "FL_BADGE_CUSTOM", description: "Add your custom overlay/badge image", optional: true, verify_block: proc do |value| UI.user_error!("custom should be a valid file path") unless value && File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :no_badge, env_name: "FL_BADGE_NO_BADGE", description: "Hides the beta badge", optional: true, type: Boolean, verify_block: proc do |value| UI.user_error!("no_badge is only a flag and should always be true") unless value == true end), FastlaneCore::ConfigItem.new(key: :shield, env_name: "FL_BADGE_SHIELD", description: "Add a shield to your app icon from shields.io", optional: true), FastlaneCore::ConfigItem.new(key: :alpha, env_name: "FL_BADGE_ALPHA", description: "Adds and alpha badge instead of the default beta one", optional: true, type: Boolean, verify_block: proc do |value| UI.user_error!("alpha is only a flag and should always be true") unless value == true end), FastlaneCore::ConfigItem.new(key: :path, env_name: "FL_BADGE_PATH", description: "Sets the root path to look for AppIcons", optional: true, default_value: '.', verify_block: proc do |value| UI.user_error!("path needs to be a valid directory") if Dir[value].empty? end), FastlaneCore::ConfigItem.new(key: :shield_io_timeout, env_name: "FL_BADGE_SHIELD_IO_TIMEOUT", description: "Set custom duration for the timeout of the shields.io request in seconds", optional: true, type: Integer, # allow integers, strings both verify_block: proc do |value| UI.user_error!("shield_io_timeout needs to be an integer > 0") if value.to_i < 1 end), FastlaneCore::ConfigItem.new(key: :glob, env_name: "FL_BADGE_GLOB", description: "Glob pattern for finding image files", optional: true), FastlaneCore::ConfigItem.new(key: :alpha_channel, env_name: "FL_BADGE_ALPHA_CHANNEL", description: "Keeps/adds an alpha channel to the icon (useful for android icons)", optional: true, type: Boolean, verify_block: proc do |value| UI.user_error!("alpha_channel is only a flag and should always be true") unless value == true end), FastlaneCore::ConfigItem.new(key: :shield_gravity, env_name: "FL_BADGE_SHIELD_GRAVITY", description: "Position of shield on icon. Default: North - Choices include: NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast", optional: true), FastlaneCore::ConfigItem.new(key: :shield_no_resize, env_name: "FL_BADGE_SHIELD_NO_RESIZE", description: "Shield image will no longer be resized to aspect fill the full icon. Instead it will only be shrunk to not exceed the icon graphic", optional: true, type: Boolean, verify_block: proc do |value| UI.user_error!("shield_no_resize is only a flag and should always be true") unless value == true end) ] end def self.authors ["DanielGri"] end def self.is_supported?(platform) [:ios, :mac, :android].include?(platform) end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/setup_travis.rb
fastlane/lib/fastlane/actions/setup_travis.rb
module Fastlane module Actions class SetupTravisAction < Action def self.run(params) other_action.setup_ci(provider: "travis", force: params[:force]) end ##################################################### # @!group Documentation ##################################################### def self.description "Setup the keychain and match to work with Travis CI" end def self.details list = <<-LIST.markdown_list(true) Creates a new temporary keychain for use with match Switches match to `readonly` mode to not create new profiles/cert on CI LIST [ list, "This action helps with Travis integration. Add this to the top of your Fastfile if you use Travis." ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :force, env_name: "FL_SETUP_TRAVIS_FORCE", description: "Force setup, even if not executed by travis", type: Boolean, default_value: false) ] end def self.authors ["KrauseFx"] end def self.is_supported?(platform) true end def self.example_code [ 'setup_travis' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/ssh.rb
fastlane/lib/fastlane/actions/ssh.rb
module Fastlane module Actions module SharedValues SSH_STDOUT_VALUE = :SSH_STDOUT_VALUE SSH_STDERR_VALUE = :SSH_STDERR_VALUE end class SshAction < Action def self.ssh_exec!(ssh, command, log = true) stdout_data = "" stderr_data = "" exit_code = nil exit_signal = nil ssh.open_channel do |channel| channel.exec(command) do |ch, success| unless success abort("FAILED: couldn't execute command (ssh.channel.exec)") end channel.on_data do |ch1, data| stdout_data += data UI.command_output(data) if log end channel.on_extended_data do |ch2, type, data| # Only type 1 data is stderr (though no other types are defined by the standard) # See http://net-ssh.github.io/net-ssh/Net/SSH/Connection/Channel.html#method-i-on_extended_data stderr_data += data if type == 1 end channel.on_request("exit-status") do |ch3, data| exit_code = data.read_long end channel.on_request("exit-signal") do |ch4, data| exit_signal = data.read_long end end end # Wait for all open channels to close ssh.loop { stdout: stdout_data, stderr: stderr_data, exit_code: exit_code, exit_signal: exit_signal } end def self.run(params) Actions.verify_gem!('net-ssh') require "net/ssh" Actions.lane_context[SharedValues::SSH_STDOUT_VALUE] = "" Actions.lane_context[SharedValues::SSH_STDERR_VALUE] = "" stdout = "" stderr = "" Net::SSH.start(params[:host], params[:username], { port: params[:port].to_i, password: params[:password] }) do |ssh| params[:commands].each do |cmd| UI.command(cmd) if params[:log] return_value = ssh_exec!(ssh, cmd, params[:log]) if return_value[:exit_code] != 0 UI.error("SSH Command failed '#{cmd}' Exit-Code: #{return_value[:exit_code]}") UI.user_error!("SSH Command failed") end stderr << return_value[:stderr] stdout << return_value[:stdout] end end command_word = params[:commands].count == 1 ? "command" : "commands" UI.success("Successfully executed #{params[:commands].count} #{command_word} on host #{params[:host]}") Actions.lane_context[SharedValues::SSH_STDOUT_VALUE] = stdout Actions.lane_context[SharedValues::SSH_STDERR_VALUE] = stderr return { stdout: Actions.lane_context[SharedValues::SSH_STDOUT_VALUE], stderr: Actions.lane_context[SharedValues::SSH_STDERR_VALUE] } end ##################################################### # @!group Documentation ##################################################### def self.description "Allows remote command execution using ssh" end def self.details "Lets you execute remote commands via ssh using username/password or ssh-agent. If one of the commands in command-array returns non 0, it fails." end def self.available_options [ FastlaneCore::ConfigItem.new(key: :username, short_option: "-u", env_name: "FL_SSH_USERNAME", description: "Username"), FastlaneCore::ConfigItem.new(key: :password, short_option: "-p", env_name: "FL_SSH_PASSWORD", sensitive: true, description: "Password", optional: true), FastlaneCore::ConfigItem.new(key: :host, short_option: "-H", env_name: "FL_SSH_HOST", description: "Hostname"), FastlaneCore::ConfigItem.new(key: :port, short_option: "-P", env_name: "FL_SSH_PORT", description: "Port", optional: true, default_value: "22"), FastlaneCore::ConfigItem.new(key: :commands, short_option: "-C", env_name: "FL_SSH_COMMANDS", description: "Commands", optional: true, type: Array), FastlaneCore::ConfigItem.new(key: :log, short_option: "-l", env_name: "FL_SSH_LOG", description: "Log commands and output", optional: true, default_value: true, type: Boolean) ] end def self.output [ ['SSH_STDOUT_VALUE', 'Holds the standard output of all commands'], ['SSH_STDERR_VALUE', 'Holds the standard error of all commands'] ] end def self.authors ["hjanuschka"] end def self.is_supported?(platform) true end def self.example_code [ 'ssh( host: "dev.januschka.com", username: "root", commands: [ "date", "echo 1 > /tmp/file1" ] )' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/ensure_git_branch.rb
fastlane/lib/fastlane/actions/ensure_git_branch.rb
module Fastlane module Actions module SharedValues end # Raises an exception and stop the lane execution if the repo is not on a specific branch class EnsureGitBranchAction < Action def self.run(params) branch = params[:branch] branch_expr = /#{branch}/ if Actions.git_branch =~ branch_expr UI.success("Git branch matches `#{branch}`, all good! 💪") else UI.user_error!("Git is not on a branch matching `#{branch}`. Current branch is `#{Actions.git_branch}`! Please ensure the repo is checked out to the correct branch.") end end ##################################################### # @!group Documentation ##################################################### def self.description "Raises an exception if not on a specific git branch" end def self.details [ "This action will check if your git repo is checked out to a specific branch.", "You may only want to make releases from a specific branch, so `ensure_git_branch` will stop a lane if it was accidentally executed on an incorrect branch." ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :branch, env_name: "FL_ENSURE_GIT_BRANCH_NAME", description: "The branch that should be checked for. String that can be either the full name of the branch or a regex e.g. `^feature\/.*$` to match", default_value: 'master') ] end def self.output [] end def self.author ['dbachrach', 'Liquidsoul'] end def self.example_code [ "ensure_git_branch # defaults to `master` branch", "ensure_git_branch( branch: 'develop' )" ] end def self.category :source_control end def self.is_supported?(platform) true end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/testflight.rb
fastlane/lib/fastlane/actions/testflight.rb
module Fastlane module Actions require 'fastlane/actions/upload_to_testflight' class TestflightAction < UploadToTestflightAction ##################################################### # @!group Documentation ##################################################### def self.description "Alias for the `upload_to_testflight` action" end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/slack.rb
fastlane/lib/fastlane/actions/slack.rb
require 'fastlane/notification/slack' # rubocop:disable Style/CaseEquality # rubocop:disable Style/MultilineTernaryOperator # rubocop:disable Style/NestedTernaryOperator module Fastlane module Actions class SlackAction < Action class Runner def initialize(slack_url) @notifier = Fastlane::Notification::Slack.new(slack_url) end def run(options) options[:message] = self.class.trim_message(options[:message].to_s || '') options[:message] = Fastlane::Notification::Slack::LinkConverter.convert(options[:message]) options[:pretext] = options[:pretext].gsub('\n', "\n") unless options[:pretext].nil? if options[:channel].to_s.length > 0 channel = options[:channel] channel = ('#' + options[:channel]) unless ['#', '@'].include?(channel[0]) # send message to channel by default end username = options[:use_webhook_configured_username_and_icon] ? nil : options[:username] slack_attachment = self.class.generate_slack_attachments(options) link_names = options[:link_names] icon_url = options[:use_webhook_configured_username_and_icon] ? nil : options[:icon_url] icon_emoji = options[:use_webhook_configured_username_and_icon] ? nil : options[:icon_emoji] post_message( channel: channel, username: username, attachments: [slack_attachment], link_names: link_names, icon_url: icon_url, icon_emoji: icon_emoji, fail_on_error: options[:fail_on_error] ) end def post_message(channel:, username:, attachments:, link_names:, icon_url:, icon_emoji:, fail_on_error:) @notifier.post_to_legacy_incoming_webhook( channel: channel, username: username, link_names: link_names, icon_url: icon_url, icon_emoji: icon_emoji, attachments: attachments ) UI.success('Successfully sent Slack notification') rescue => error UI.error("Exception: #{error}") message = "Error pushing Slack message, maybe the integration has no permission to post on this channel? Try removing the channel parameter in your Fastfile, this is usually caused by a misspelled or changed group/channel name or an expired SLACK_URL" if fail_on_error UI.user_error!(message) else UI.error(message) end end # As there is a text limit in the notifications, we are # usually interested in the last part of the message # e.g. for tests def self.trim_message(message) # We want the last 7000 characters, instead of the first 7000, as the error is at the bottom start_index = [message.length - 7000, 0].max message = message[start_index..-1] # We want line breaks to be shown on slack output so we replace # input non-interpreted line break with interpreted line break message.gsub('\n', "\n") end def self.generate_slack_attachments(options) color = (options[:success] ? 'good' : 'danger') should_add_payload = ->(payload_name) { options[:default_payloads].map(&:to_sym).include?(payload_name.to_sym) } slack_attachment = { fallback: options[:message], text: options[:message], pretext: options[:pretext], color: color, mrkdwn_in: ["pretext", "text", "fields", "message"], fields: [] } # custom user payloads slack_attachment[:fields] += options[:payload].map do |k, v| { title: k.to_s, value: Fastlane::Notification::Slack::LinkConverter.convert(v.to_s), short: false } end # Add the lane to the Slack message # This might be nil, if slack is called as "one-off" action if should_add_payload[:lane] && Actions.lane_context[Actions::SharedValues::LANE_NAME] slack_attachment[:fields] << { title: 'Lane', value: Actions.lane_context[Actions::SharedValues::LANE_NAME], short: true } end # test_result if should_add_payload[:test_result] slack_attachment[:fields] << { title: 'Result', value: (options[:success] ? 'Success' : 'Error'), short: true } end # git branch if Actions.git_branch && should_add_payload[:git_branch] slack_attachment[:fields] << { title: 'Git Branch', value: Actions.git_branch, short: true } end # git_author if Actions.git_author_email && should_add_payload[:git_author] if FastlaneCore::Env.truthy?('FASTLANE_SLACK_HIDE_AUTHOR_ON_SUCCESS') && options[:success] # We only show the git author if the build failed else slack_attachment[:fields] << { title: 'Git Author', value: Actions.git_author_email, short: true } end end # last_git_commit if Actions.last_git_commit_message && should_add_payload[:last_git_commit] slack_attachment[:fields] << { title: 'Git Commit', value: Actions.last_git_commit_message, short: false } end # last_git_commit_hash if Actions.last_git_commit_hash(true) && should_add_payload[:last_git_commit_hash] slack_attachment[:fields] << { title: 'Git Commit Hash', value: Actions.last_git_commit_hash(short: true), short: false } end # merge additional properties deep_merge(slack_attachment, options[:attachment_properties]) end # Adapted from https://stackoverflow.com/a/30225093/158525 def self.deep_merge(a, b) merger = proc do |key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : Array === v1 && Array === v2 ? v1 | v2 : [:undefined, nil, :nil].include?(v2) ? v1 : v2 end a.merge(b, &merger) end end def self.is_supported?(platform) true end def self.run(options) Runner.new(options[:slack_url]).run(options) end def self.description "Send a success/error message to your [Slack](https://slack.com) group" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :message, env_name: "FL_SLACK_MESSAGE", description: "The message that should be displayed on Slack. This supports the standard Slack markup language", optional: true), FastlaneCore::ConfigItem.new(key: :pretext, env_name: "FL_SLACK_PRETEXT", description: "This is optional text that appears above the message attachment block. This supports the standard Slack markup language", optional: true), FastlaneCore::ConfigItem.new(key: :channel, env_name: "FL_SLACK_CHANNEL", description: "#channel or @username", optional: true), FastlaneCore::ConfigItem.new(key: :use_webhook_configured_username_and_icon, env_name: "FL_SLACK_USE_WEBHOOK_CONFIGURED_USERNAME_AND_ICON", description: "Use webhook's default username and icon settings? (true/false)", default_value: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :slack_url, env_name: "SLACK_URL", sensitive: true, description: "Create an Incoming WebHook for your Slack group", verify_block: proc do |value| UI.user_error!("Invalid URL, must start with https://") unless value.start_with?("https://") end), FastlaneCore::ConfigItem.new(key: :username, env_name: "FL_SLACK_USERNAME", description: "Overrides the webhook's username property if use_webhook_configured_username_and_icon is false", default_value: "fastlane", optional: true), FastlaneCore::ConfigItem.new(key: :icon_url, env_name: "FL_SLACK_ICON_URL", description: "Specifies a URL of an image to use as the photo of the message. Overrides the webhook's image property if use_webhook_configured_username_and_icon is false", default_value: "https://fastlane.tools/assets/img/fastlane_icon.png", optional: true), FastlaneCore::ConfigItem.new(key: :icon_emoji, env_name: "FL_SLACK_ICON_EMOJI", description: "Specifies an emoji (using colon shortcodes, eg. :white_check_mark:) to use as the photo of the message. Overrides the webhook's image property if use_webhook_configured_username_and_icon is false. This parameter takes precedence over icon_url", optional: true), FastlaneCore::ConfigItem.new(key: :payload, env_name: "FL_SLACK_PAYLOAD", description: "Add additional information to this post. payload must be a hash containing any key with any value", default_value: {}, type: Hash), FastlaneCore::ConfigItem.new(key: :default_payloads, env_name: "FL_SLACK_DEFAULT_PAYLOADS", description: "Specifies default payloads to include. Pass an empty array to suppress all the default payloads", default_value: ['lane', 'test_result', 'git_branch', 'git_author', 'last_git_commit', 'last_git_commit_hash'], type: Array), FastlaneCore::ConfigItem.new(key: :attachment_properties, env_name: "FL_SLACK_ATTACHMENT_PROPERTIES", description: "Merge additional properties in the slack attachment, see https://api.slack.com/docs/attachments", default_value: {}, type: Hash), FastlaneCore::ConfigItem.new(key: :success, env_name: "FL_SLACK_SUCCESS", description: "Was this build successful? (true/false)", optional: true, default_value: true, type: Boolean), FastlaneCore::ConfigItem.new(key: :fail_on_error, env_name: "FL_SLACK_FAIL_ON_ERROR", description: "Should an error sending the slack notification cause a failure? (true/false)", optional: true, default_value: true, type: Boolean), FastlaneCore::ConfigItem.new(key: :link_names, env_name: "FL_SLACK_LINK_NAMES", description: "Find and link channel names and usernames (true/false)", optional: true, default_value: false, type: Boolean) ] end def self.author "KrauseFx" end def self.example_code [ 'slack(message: "App successfully released!")', 'slack( message: "App successfully released!", channel: "#channel", # Optional, by default will post to the default channel configured for the POST URL. success: true, # Optional, defaults to true. payload: { # Optional, lets you specify any number of your own Slack attachments. "Build Date" => Time.new.to_s, "Built by" => "Jenkins", }, default_payloads: [:git_branch, :git_author], # Optional, lets you specify default payloads to include. Pass an empty array to suppress all the default payloads. attachment_properties: { # Optional, lets you specify any other properties available for attachments in the slack API (see https://api.slack.com/docs/attachments). # This hash is deep merged with the existing properties set using the other properties above. This allows your own fields properties to be appended to the existing fields that were created using the `payload` property for instance. thumb_url: "http://example.com/path/to/thumb.png", fields: [{ title: "My Field", value: "My Value", short: true }] } )' ] end def self.category :notifications end def self.details "Create an Incoming WebHook and export this as `SLACK_URL`. Can send a message to **#channel** (by default), a direct message to **@username** or a message to a private group **group** with success (green) or failure (red) status." end ##################################################### # @!group Helper ##################################################### def self.trim_message(message) Runner.trim_message(message) end def self.generate_slack_attachments(options) UI.deprecated('`Fastlane::Actions::Slack.generate_slack_attachments` is subject to be removed as Slack recommends migrating `attachments` to Block Kit. fastlane will also follow the same direction.') Runner.generate_slack_attachments(options) end end end end # rubocop:enable Style/CaseEquality # rubocop:enable Style/MultilineTernaryOperator # rubocop:enable Style/NestedTernaryOperator
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/update_icloud_container_identifiers.rb
fastlane/lib/fastlane/actions/update_icloud_container_identifiers.rb
module Fastlane module Actions module SharedValues UPDATE_ICLOUD_CONTAINER_IDENTIFIERS = :UPDATE_ICLOUD_CONTAINER_IDENTIFIERS end class UpdateIcloudContainerIdentifiersAction < Action require 'plist' def self.run(params) entitlements_file = params[:entitlements_file] UI.message("Entitlements File: #{entitlements_file}") # parse entitlements result = Plist.parse_xml(entitlements_file) UI.error("Entitlements file at '#{entitlements_file}' cannot be parsed.") unless result # get iCloud container field icloud_container_key = 'com.apple.developer.icloud-container-identifiers' icloud_container_value = result[icloud_container_key] UI.error("No existing iCloud container field specified. Please specify an iCloud container in the entitlements file.") unless icloud_container_value # get uniquity container field ubiquity_container_key = 'com.apple.developer.ubiquity-container-identifiers' ubiquity_container_value = result[ubiquity_container_key] UI.error("No existing ubiquity container field specified. Please specify an ubiquity container in the entitlements file.") unless ubiquity_container_value # set iCloud container identifiers result[icloud_container_key] = params[:icloud_container_identifiers] result[ubiquity_container_key] = params[:icloud_container_identifiers] # save entitlements file result.save_plist(entitlements_file) UI.message("Old iCloud Container Identifiers: #{icloud_container_value}") UI.message("Old Ubiquity Container Identifiers: #{ubiquity_container_value}") UI.success("New iCloud Container Identifiers set: #{result[icloud_container_key]}") UI.success("New Ubiquity Container Identifiers set: #{result[ubiquity_container_key]}") Actions.lane_context[SharedValues::UPDATE_ICLOUD_CONTAINER_IDENTIFIERS] = result[icloud_container_key] end def self.description "This action changes the iCloud container identifiers in the entitlements file" end def self.details "Updates the iCloud Container Identifiers in the given Entitlements file, so you can use different iCloud containers for different builds like Adhoc, App Store, etc." end def self.available_options [ FastlaneCore::ConfigItem.new(key: :entitlements_file, env_name: "FL_UPDATE_ICLOUD_CONTAINER_IDENTIFIERS_ENTITLEMENTS_FILE_PATH", description: "The path to the entitlement file which contains the iCloud container identifiers", verify_block: proc do |value| UI.user_error!("Please pass a path to an entitlements file. ") unless value.include?(".entitlements") UI.user_error!("Could not find entitlements file") if !File.exist?(value) && !Helper.test? end), FastlaneCore::ConfigItem.new(key: :icloud_container_identifiers, env_name: "FL_UPDATE_ICLOUD_CONTAINER_IDENTIFIERS_IDENTIFIERS", description: "An Array of unique identifiers for the iCloud containers. Eg. ['iCloud.com.test.testapp']", type: Array) ] end def self.output [ ['UPDATE_ICLOUD_CONTAINER_IDENTIFIERS', 'The new iCloud Container Identifiers'] ] end def self.authors ["JamesKuang"] end def self.is_supported?(platform) platform == :ios end def self.example_code [ 'update_icloud_container_identifiers( entitlements_file: "/path/to/entitlements_file.entitlements", icloud_container_identifiers: ["iCloud.com.companyname.appname"] )' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/git_commit.rb
fastlane/lib/fastlane/actions/git_commit.rb
module Fastlane module Actions class GitCommitAction < Action def self.run(params) paths = params[:path] skip_git_hooks = params[:skip_git_hooks] ? ['--no-verify'] : [] if params[:allow_nothing_to_commit] # Here we check if the path passed in parameter contains any modification # and we skip the `git commit` command if there is none. # That means you can have other files modified that are not in the path parameter # and still make use of allow_nothing_to_commit. repo_clean = Actions.sh('git', 'status', *paths, '--porcelain').empty? UI.success("Nothing to commit, working tree clean ✅.") if repo_clean return if repo_clean end result = Actions.sh('git', 'commit', '-m', params[:message], *paths, *skip_git_hooks) UI.success("Successfully committed \"#{params[:path]}\" 💾.") return result end ##################################################### # @!group Documentation ##################################################### def self.description "Directly commit the given file with the given message" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :path, description: "The file(s) or directory(ies) you want to commit. You can pass an array of multiple file-paths or fileglobs \"*.txt\" to commit all matching files. The files already staged but not specified and untracked files won't be committed", type: Array), FastlaneCore::ConfigItem.new(key: :message, description: "The commit message that should be used"), FastlaneCore::ConfigItem.new(key: :skip_git_hooks, description: "Set to true to pass `--no-verify` to git", default_value: false, type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :allow_nothing_to_commit, description: "Set to true to allow commit without any git changes in the files you want to commit", default_value: false, type: Boolean, optional: true) ] end def self.output end def self.return_value nil end def self.authors ["KrauseFx"] end def self.is_supported?(platform) true end def self.example_code [ 'git_commit(path: "./version.txt", message: "Version Bump")', 'git_commit(path: ["./version.txt", "./changelog.txt"], message: "Version Bump")', 'git_commit(path: ["./*.txt", "./*.md"], message: "Update documentation")', 'git_commit(path: ["./*.txt", "./*.md"], message: "Update documentation", skip_git_hooks: true)' ] end def self.category :source_control end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/push_to_git_remote.rb
fastlane/lib/fastlane/actions/push_to_git_remote.rb
module Fastlane module Actions # Push local changes to the remote branch class PushToGitRemoteAction < Action def self.run(params) # Find the local git branch using HEAD or fallback to CI's ENV git branch if you're in detached HEAD state local_git_branch = Actions.git_branch_name_using_HEAD local_git_branch = Actions.git_branch unless local_git_branch && local_git_branch != "HEAD" local_branch = params[:local_branch] local_branch ||= local_git_branch.gsub(%r{#{params[:remote]}\/}, '') if local_git_branch UI.user_error!('Failed to get the current branch.') unless local_branch remote_branch = params[:remote_branch] || local_branch # construct our command as an array of components command = [ 'git', 'push', params[:remote], "#{local_branch.shellescape}:#{remote_branch.shellescape}" ] # optionally add the tags component command << '--tags' if params[:tags] # optionally add the force component command << '--force' if params[:force] # optionally add the force component command << '--force-with-lease' if params[:force_with_lease] # optionally add the no-verify component command << '--no-verify' if params[:no_verify] # optionally add the set-upstream component command << '--set-upstream' if params[:set_upstream] # optionally add the --push_options components params[:push_options].each { |push_option| command << "--push-option=#{push_option}" } if params[:push_options] # execute our command return command.join(' ') if Helper.test? Actions.sh(command.join(' ')) UI.message('Successfully pushed to remote.') end def self.description "Push local changes to the remote branch" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :local_branch, env_name: "FL_GIT_PUSH_LOCAL_BRANCH", description: "The local branch to push from. Defaults to the current branch", default_value_dynamic: true, optional: true), FastlaneCore::ConfigItem.new(key: :remote_branch, env_name: "FL_GIT_PUSH_REMOTE_BRANCH", description: "The remote branch to push to. Defaults to the local branch", default_value_dynamic: true, optional: true), FastlaneCore::ConfigItem.new(key: :force, env_name: "FL_PUSH_GIT_FORCE", description: "Force push to remote", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :force_with_lease, env_name: "FL_PUSH_GIT_FORCE_WITH_LEASE", description: "Force push with lease to remote", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :tags, env_name: "FL_PUSH_GIT_TAGS", description: "Whether tags are pushed to remote", type: Boolean, default_value: true), FastlaneCore::ConfigItem.new(key: :remote, env_name: "FL_GIT_PUSH_REMOTE", description: "The remote to push to", default_value: 'origin'), FastlaneCore::ConfigItem.new(key: :no_verify, env_name: "FL_GIT_PUSH_USE_NO_VERIFY", description: "Whether or not to use --no-verify", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :set_upstream, env_name: "FL_GIT_PUSH_USE_SET_UPSTREAM", description: "Whether or not to use --set-upstream", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :push_options, env_name: "FL_GIT_PUSH_PUSH_OPTION", description: "Array of strings to be passed using the '--push-option' option", type: Array, default_value: []) ] end def self.author "lmirosevic" end def self.details [ "Lets you push your local commits to a remote git repo. Useful if you make local changes such as adding a version bump commit (using `commit_version_bump`) or a git tag (using 'add_git_tag') on a CI server, and you want to push those changes back to your canonical/main repo.", "If this is a new branch, use the `set_upstream` option to set the remote branch as upstream." ].join("\n") end def self.is_supported?(platform) true end def self.example_code [ 'push_to_git_remote # simple version. pushes "master" branch to "origin" remote', 'push_to_git_remote( remote: "origin", # optional, default: "origin" local_branch: "develop", # optional, aliased by "branch", default is set to current branch remote_branch: "develop", # optional, default is set to local_branch force: true, # optional, default: false force_with_lease: true, # optional, default: false tags: false, # optional, default: true no_verify: true, # optional, default: false set_upstream: true # optional, default: false )' ] end def self.category :source_control end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/s3.rb
fastlane/lib/fastlane/actions/s3.rb
require 'fastlane/erb_template_helper' require 'fastlane/helper/s3_client_helper' require 'ostruct' require 'uri' require 'cgi' module Fastlane module Actions module SharedValues # Using ||= because these MAY be defined by the the # preferred aws_s3 plugin S3_IPA_OUTPUT_PATH ||= :S3_IPA_OUTPUT_PATH S3_DSYM_OUTPUT_PATH ||= :S3_DSYM_OUTPUT_PATH S3_PLIST_OUTPUT_PATH ||= :S3_PLIST_OUTPUT_PATH S3_HTML_OUTPUT_PATH ||= :S3_HTML_OUTPUT_PATH S3_VERSION_OUTPUT_PATH ||= :S3_VERSION_OUTPUT_PATH end class S3Action < Action def self.run(config) UI.user_error!("Please use the `aws_s3` plugin instead. Install using `fastlane add_plugin aws_s3`.") end def self.description "Generates a plist file and uploads all to AWS S3" end def self.details [ "Upload a new build to Amazon S3 to distribute the build to beta testers.", "Works for both Ad Hoc and Enterprise signed applications. This step will generate the necessary HTML, plist, and version files for you.", "It is recommended to **not** store the AWS access keys in the `Fastfile`. The uploaded `version.json` file provides an easy way for apps to poll if a new update is available." ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :ipa, env_name: "", description: ".ipa file for the build ", optional: true, default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH], default_value_dynamic: true), FastlaneCore::ConfigItem.new(key: :dsym, env_name: "", description: "zipped .dsym package for the build ", optional: true, default_value: Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH], default_value_dynamic: true), FastlaneCore::ConfigItem.new(key: :upload_metadata, env_name: "", description: "Upload relevant metadata for this build", optional: true, default_value: true, type: Boolean), FastlaneCore::ConfigItem.new(key: :plist_template_path, env_name: "", description: "plist template path", optional: true), FastlaneCore::ConfigItem.new(key: :plist_file_name, env_name: "", description: "uploaded plist filename", optional: true), FastlaneCore::ConfigItem.new(key: :html_template_path, env_name: "", description: "html erb template path", optional: true), FastlaneCore::ConfigItem.new(key: :html_file_name, env_name: "", description: "uploaded html filename", optional: true), FastlaneCore::ConfigItem.new(key: :version_template_path, env_name: "", description: "version erb template path", optional: true), FastlaneCore::ConfigItem.new(key: :version_file_name, env_name: "", description: "uploaded version filename", optional: true), FastlaneCore::ConfigItem.new(key: :access_key, env_name: "S3_ACCESS_KEY", description: "AWS Access Key ID ", sensitive: true, optional: true, default_value: ENV['AWS_ACCESS_KEY_ID'], default_value_dynamic: true), FastlaneCore::ConfigItem.new(key: :secret_access_key, env_name: "S3_SECRET_ACCESS_KEY", description: "AWS Secret Access Key ", sensitive: true, optional: true, default_value: ENV['AWS_SECRET_ACCESS_KEY'], default_value_dynamic: true), FastlaneCore::ConfigItem.new(key: :bucket, env_name: "S3_BUCKET", description: "AWS bucket name", optional: true, code_gen_sensitive: true, default_value: ENV['AWS_BUCKET_NAME'], default_value_dynamic: true), FastlaneCore::ConfigItem.new(key: :region, env_name: "S3_REGION", description: "AWS region (for bucket creation) ", optional: true, code_gen_sensitive: true, default_value: ENV['AWS_REGION'], default_value_dynamic: true), FastlaneCore::ConfigItem.new(key: :path, env_name: "S3_PATH", description: "S3 'path'. Values from Info.plist will be substituted for keys wrapped in {} ", optional: true, default_value: 'v{CFBundleShortVersionString}_b{CFBundleVersion}/'), FastlaneCore::ConfigItem.new(key: :source, env_name: "S3_SOURCE", description: "Optional source directory e.g. ./build ", optional: true), FastlaneCore::ConfigItem.new(key: :acl, env_name: "S3_ACL", description: "Uploaded object permissions e.g public_read (default), private, public_read_write, authenticated_read ", optional: true, default_value: "public_read") ] end def self.output [ ['S3_IPA_OUTPUT_PATH', 'Direct HTTP link to the uploaded ipa file'], ['S3_DSYM_OUTPUT_PATH', 'Direct HTTP link to the uploaded dsym file'], ['S3_PLIST_OUTPUT_PATH', 'Direct HTTP link to the uploaded plist file'], ['S3_HTML_OUTPUT_PATH', 'Direct HTTP link to the uploaded HTML file'], ['S3_VERSION_OUTPUT_PATH', 'Direct HTTP link to the uploaded Version file'] ] end def self.author "joshdholtz" end def self.is_supported?(platform) false end def self.example_code [ 's3', 's3( # All of these are used to make Shenzhen\'s `ipa distribute:s3` command access_key: ENV["S3_ACCESS_KEY"], # Required from user. secret_access_key: ENV["S3_SECRET_ACCESS_KEY"], # Required from user. bucket: ENV["S3_BUCKET"], # Required from user. ipa: "AppName.ipa", # Optional if you use `ipa` to build dsym: "AppName.app.dSYM.zip", # Optional if you use `ipa` to build path: "v{CFBundleShortVersionString}_b{CFBundleVersion}/", # This is actually the default. upload_metadata: true, # Upload version.json, plist and HTML. Set to false to skip uploading of these files. version_file_name: "app_version.json", # Name of the file to upload to S3. Defaults to "version.json" version_template_path: "path/to/erb" # Path to an ERB to configure the structure of the version JSON file )' ] end def self.category :deprecated end def self.deprecated_notes [ "Please use the `aws_s3` plugin instead.", "Install using `fastlane add_plugin aws_s3`." ].join("\n") end end # rubocop:enable Metrics/ClassLength end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/reset_simulator_contents.rb
fastlane/lib/fastlane/actions/reset_simulator_contents.rb
module Fastlane module Actions class ResetSimulatorContentsAction < Action def self.run(params) os_versions = params[:os_versions] || params[:ios] reset_simulators(os_versions) end def self.reset_simulators(os_versions) UI.verbose("Resetting simulator contents") if os_versions os_versions.each do |os_version| reset_all_by_version(os_version) end else reset_all end UI.success('Simulators reset done') end def self.reset_all_by_version(os_version) FastlaneCore::Simulator.reset_all_by_version(os_version: os_version) FastlaneCore::SimulatorTV.reset_all_by_version(os_version: os_version) FastlaneCore::SimulatorWatch.reset_all_by_version(os_version: os_version) end def self.reset_all FastlaneCore::Simulator.reset_all FastlaneCore::SimulatorTV.reset_all FastlaneCore::SimulatorWatch.reset_all end def self.description "Shutdown and reset running simulators" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :ios, deprecated: "Use `:os_versions` instead", short_option: "-i", env_name: "FASTLANE_RESET_SIMULATOR_VERSIONS", description: "Which OS versions of Simulators you want to reset content and settings, this does not remove/recreate the simulators", optional: true, type: Array), FastlaneCore::ConfigItem.new(key: :os_versions, short_option: "-v", env_name: "FASTLANE_RESET_SIMULATOR_OS_VERSIONS", description: "Which OS versions of Simulators you want to reset content and settings, this does not remove/recreate the simulators", optional: true, type: Array) ] end def self.aliases ["reset_simulators"] end def self.output nil end def self.return_value nil end def self.authors ["danramteke"] end def self.is_supported?(platform) [:ios, :tvos, :watchos].include?(platform) end def self.example_code [ 'reset_simulator_contents', 'reset_simulator_contents(os_versions: ["10.3.1","12.2"])' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/pem.rb
fastlane/lib/fastlane/actions/pem.rb
module Fastlane module Actions require 'fastlane/actions/get_push_certificate' class PemAction < GetPushCertificateAction ##################################################### # @!group Documentation ##################################################### def self.description "Alias for the `get_push_certificate` action" end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/restore_file.rb
fastlane/lib/fastlane/actions/restore_file.rb
module Fastlane module Actions class RestoreFileAction < Action def self.run(params) path = params[:path] backup_path = "#{path}.back" UI.user_error!("Could not find file '#{backup_path}'") unless File.exist?(backup_path) FileUtils.cp(backup_path, path, preserve: true) FileUtils.rm(backup_path) UI.message("Successfully restored backup 📤") end def self.description 'This action restore your file that was backed up with the `backup_file` action' end def self.is_supported?(platform) true end def self.author "gin0606" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :path, description: "Original file name you want to restore", optional: false) ] end def self.example_code [ 'restore_file(path: "/path/to/file")' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/git_pull.rb
fastlane/lib/fastlane/actions/git_pull.rb
module Fastlane module Actions class GitPullAction < Action def self.run(params) commands = [] unless params[:only_tags] command = "git pull" command << " --rebase" if params[:rebase] commands += ["#{command} &&"] end commands += ["git fetch --tags"] Actions.sh(commands.join(' ')) end def self.description "Executes a simple git pull command" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :only_tags, description: "Simply pull the tags, and not bring new commits to the current branch from the remote", type: Boolean, optional: true, default_value: false), FastlaneCore::ConfigItem.new(key: :rebase, description: "Rebase on top of the remote branch instead of merge", type: Boolean, optional: true, default_value: false) ] end def self.authors ["KrauseFx", "JaviSoto"] end def self.is_supported?(platform) true end def self.example_code [ 'git_pull', 'git_pull(only_tags: true) # only the tags, no commits', 'git_pull(rebase: true) # use --rebase with pull' ] end def self.category :source_control end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/make_changelog_from_jenkins.rb
fastlane/lib/fastlane/actions/make_changelog_from_jenkins.rb
module Fastlane module Actions module SharedValues FL_CHANGELOG ||= :FL_CHANGELOG # originally defined in ChangelogFromGitCommitsAction end class MakeChangelogFromJenkinsAction < Action def self.run(params) require 'json' require 'net/http' changelog = "" if Helper.ci? || Helper.test? # The "BUILD_URL" environment variable is set automatically by Jenkins in every build jenkins_api_url = URI(ENV["BUILD_URL"] + "api/json\?wrapper\=changes\&xpath\=//changeSet//comment") begin json = JSON.parse(Net::HTTP.get(jenkins_api_url)) json['changeSet']['items'].each do |item| comment = params[:include_commit_body] ? item['comment'] : item['msg'] changelog << comment.strip + "\n" end rescue => ex UI.error("Unable to read/parse changelog from jenkins: #{ex.message}") end end Actions.lane_context[SharedValues::FL_CHANGELOG] = changelog.strip.length > 0 ? changelog : params[:fallback_changelog] end def self.description "Generate a changelog using the Changes section from the current Jenkins build" end def self.details "This is useful when deploying automated builds. The changelog from Jenkins lists all the commit messages since the last build." end def self.available_options [ FastlaneCore::ConfigItem.new(key: :fallback_changelog, description: "Fallback changelog if there is not one on Jenkins, or it couldn't be read", optional: true, default_value: ""), FastlaneCore::ConfigItem.new(key: :include_commit_body, description: "Include the commit body along with the summary", optional: true, type: Boolean, default_value: true) ] end def self.output [ ['FL_CHANGELOG', 'The changelog generated by Jenkins'] ] end def self.authors ["mandrizzle"] end def self.is_supported?(platform) true end def self.example_code [ 'make_changelog_from_jenkins( # Optional, lets you set a changelog in the case is not generated on Jenkins or if ran outside of Jenkins fallback_changelog: "Bug fixes and performance enhancements" )' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/debug.rb
fastlane/lib/fastlane/actions/debug.rb
module Fastlane module Actions class DebugAction < Action def self.run(params) puts("Lane Context".green) puts(Actions.lane_context) end def self.description "Print out an overview of the lane context values" end def self.is_supported?(platform) true end def self.example_code [ 'debug' ] end def self.category :misc end def self.author "KrauseFx" end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/pod_lib_lint.rb
fastlane/lib/fastlane/actions/pod_lib_lint.rb
module Fastlane module Actions class PodLibLintAction < Action # rubocop:disable Metrics/PerceivedComplexity def self.run(params) command = [] command << "bundle exec" if params[:use_bundle_exec] && shell_out_should_use_bundle_exec? command << "pod lib lint" command << params[:podspec] if params[:podspec] command << "--verbose" if params[:verbose] command << "--allow-warnings" if params[:allow_warnings] command << "--sources='#{params[:sources].join(',')}'" if params[:sources] command << "--subspec='#{params[:subspec]}'" if params[:subspec] command << "--include-podspecs='#{params[:include_podspecs]}'" if params[:include_podspecs] command << "--external-podspecs='#{params[:external_podspecs]}'" if params[:external_podspecs] command << "--swift-version=#{params[:swift_version]}" if params[:swift_version] command << "--use-libraries" if params[:use_libraries] command << "--use-modular-headers" if params[:use_modular_headers] command << "--fail-fast" if params[:fail_fast] command << "--private" if params[:private] command << "--quick" if params[:quick] command << "--no-clean" if params[:no_clean] command << "--no-subspecs" if params[:no_subspecs] command << "--platforms=#{params[:platforms]}" if params[:platforms] command << "--skip-import-validation" if params[:skip_import_validation] command << "--skip-tests" if params[:skip_tests] command << "--analyze" if params[:analyze] result = Actions.sh(command.join(' ')) UI.success("Pod lib lint successful ⬆️ ") return result end ##################################################### # @!group Documentation ##################################################### def self.description "Pod lib lint" end def self.details "Test the syntax of your Podfile by linting the pod against the files of its directory" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :use_bundle_exec, description: "Use bundle exec when there is a Gemfile presented", type: Boolean, default_value: true, env_name: "FL_POD_LIB_LINT_USE_BUNDLE"), FastlaneCore::ConfigItem.new(key: :podspec, description: "Path of spec to lint", type: String, optional: true, env_name: "FL_POD_LIB_LINT_PODSPEC"), FastlaneCore::ConfigItem.new(key: :verbose, description: "Allow output detail in console", type: Boolean, optional: true, env_name: "FL_POD_LIB_LINT_VERBOSE"), FastlaneCore::ConfigItem.new(key: :allow_warnings, description: "Allow warnings during pod lint", type: Boolean, optional: true, env_name: "FL_POD_LIB_LINT_ALLOW_WARNINGS"), FastlaneCore::ConfigItem.new(key: :sources, description: "The sources of repos you want the pod spec to lint with, separated by commas", type: Array, optional: true, env_name: "FL_POD_LIB_LINT_SOURCES", verify_block: proc do |value| UI.user_error!("Sources must be an array.") unless value.kind_of?(Array) end), FastlaneCore::ConfigItem.new(key: :subspec, description: "A specific subspec to lint instead of the entire spec", type: String, optional: true, env_name: "FL_POD_LIB_LINT_SUBSPEC"), FastlaneCore::ConfigItem.new(key: :include_podspecs, description: "A Glob of additional ancillary podspecs which are used for linting via :path (available since cocoapods >= 1.7)", type: String, optional: true, env_name: "FL_POD_LIB_LINT_INCLUDE_PODSPECS"), FastlaneCore::ConfigItem.new(key: :external_podspecs, description: "A Glob of additional ancillary podspecs which are used for linting via :podspec. If there"\ " are --include-podspecs, then these are removed from them (available since cocoapods >= 1.7)", type: String, optional: true, env_name: "FL_POD_LIB_LINT_EXTERNAL_PODSPECS"), FastlaneCore::ConfigItem.new(key: :swift_version, description: "The SWIFT_VERSION that should be used to lint the spec. This takes precedence over a .swift-version file", type: String, optional: true, env_name: "FL_POD_LIB_LINT_SWIFT_VERSION"), FastlaneCore::ConfigItem.new(key: :use_libraries, description: "Lint uses static libraries to install the spec", type: Boolean, default_value: false, env_name: "FL_POD_LIB_LINT_USE_LIBRARIES"), FastlaneCore::ConfigItem.new(key: :use_modular_headers, description: "Lint using modular libraries (available since cocoapods >= 1.6)", type: Boolean, default_value: false, env_name: "FL_POD_LIB_LINT_USE_MODULAR_HEADERS"), FastlaneCore::ConfigItem.new(key: :fail_fast, description: "Lint stops on the first failing platform or subspec", type: Boolean, default_value: false, env_name: "FL_POD_LIB_LINT_FAIL_FAST"), FastlaneCore::ConfigItem.new(key: :private, description: "Lint skips checks that apply only to public specs", type: Boolean, default_value: false, env_name: "FL_POD_LIB_LINT_PRIVATE"), FastlaneCore::ConfigItem.new(key: :quick, description: "Lint skips checks that would require to download and build the spec", type: Boolean, default_value: false, env_name: "FL_POD_LIB_LINT_QUICK"), FastlaneCore::ConfigItem.new(key: :no_clean, description: "Lint leaves the build directory intact for inspection", type: Boolean, default_value: false, env_name: "FL_POD_LIB_LINT_NO_CLEAN"), FastlaneCore::ConfigItem.new(key: :no_subspecs, description: "Lint skips validation of subspecs", type: Boolean, default_value: false, env_name: "FL_POD_LIB_LINT_NO_SUBSPECS"), FastlaneCore::ConfigItem.new(key: :platforms, description: "Lint against specific platforms (defaults to all platforms supported by "\ "the podspec). Multiple platforms must be comma-delimited (available since cocoapods >= 1.6)", optional: true, env_name: "FL_POD_LIB_LINT_PLATFORMS"), FastlaneCore::ConfigItem.new(key: :skip_import_validation, description: "Lint skips validating that the pod can be imported (available since cocoapods >= 1.3)", type: Boolean, default_value: false, env_name: "FL_POD_LIB_LINT_SKIP_IMPORT_VALIDATION"), FastlaneCore::ConfigItem.new(key: :skip_tests, description: "Lint skips building and running tests during validation (available since cocoapods >= 1.3)", type: Boolean, default_value: false, env_name: "FL_POD_LIB_LINT_SKIP_TESTS"), FastlaneCore::ConfigItem.new(key: :analyze, description: "Validate with the Xcode Static Analysis tool (available since cocoapods >= 1.6.1)", type: Boolean, default_value: false, env_name: "FL_POD_LIB_LINT_ANALYZE") ] end def self.output end def self.return_value nil end def self.authors ["thierryxing"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'pod_lib_lint', '# Allow output detail in console pod_lib_lint(verbose: true)', '# Allow warnings during pod lint pod_lib_lint(allow_warnings: true)', '# If the podspec has a dependency on another private pod, then you will have to supply the sources pod_lib_lint(sources: ["https://github.com/username/Specs", "https://github.com/CocoaPods/Specs"])' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/capture_android_screenshots.rb
fastlane/lib/fastlane/actions/capture_android_screenshots.rb
module Fastlane module Actions module SharedValues SCREENGRAB_OUTPUT_DIRECTORY = :SCREENGRAB_OUTPUT_DIRECTORY end class CaptureAndroidScreenshotsAction < Action def self.run(params) require 'screengrab' Screengrab.config = params Screengrab.android_environment = Screengrab::AndroidEnvironment.new(params[:android_home], params[:build_tools_version]) Screengrab::DependencyChecker.check(Screengrab.android_environment) Screengrab::Runner.new.run Actions.lane_context[SharedValues::SCREENGRAB_OUTPUT_DIRECTORY] = File.expand_path(params[:output_directory]) true end def self.description 'Automated localized screenshots of your Android app (via _screengrab_)' end def self.available_options require 'screengrab' Screengrab::Options.available_options end def self.output [ ['SCREENGRAB_OUTPUT_DIRECTORY', 'The path to the output directory'] ] end def self.author ['asfalcone', 'i2amsam', 'mfurtak'] end def self.is_supported?(platform) platform == :android end def self.example_code [ 'capture_android_screenshots', 'screengrab # alias for "capture_android_screenshots"', 'capture_android_screenshots( locales: ["en-US", "fr-FR", "ja-JP"], clear_previous_screenshots: true, app_apk_path: "build/outputs/apk/example-debug.apk", tests_apk_path: "build/outputs/apk/example-debug-androidTest-unaligned.apk" )' ] end def self.category :screenshots end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/mailgun.rb
fastlane/lib/fastlane/actions/mailgun.rb
require 'fastlane/erb_template_helper' module Fastlane module Actions class MailgunAction < Action def self.is_supported?(platform) true end def self.run(options) Actions.verify_gem!('faraday') Actions.verify_gem!('mime-types') require 'faraday' begin # Use mime/types/columnar if available, for reduced memory usage require 'mime/types/columnar' rescue LoadError require 'mime/types' end handle_params_transition(options) mailgunit(options) end def self.description "Send a success/error message to an email group" end def self.available_options [ # This is here just for while due to the transition, not needed anymore FastlaneCore::ConfigItem.new(key: :mailgun_sandbox_domain, env_name: "MAILGUN_SANDBOX_POSTMASTER", optional: true, description: "Mailgun sandbox domain postmaster for your mail. Please use postmaster instead"), # This is here just for while due to the transition, should use postmaster instead FastlaneCore::ConfigItem.new(key: :mailgun_sandbox_postmaster, env_name: "MAILGUN_SANDBOX_POSTMASTER", optional: true, description: "Mailgun sandbox domain postmaster for your mail. Please use postmaster instead"), # This is here just for while due to the transition, should use apikey instead FastlaneCore::ConfigItem.new(key: :mailgun_apikey, env_name: "MAILGUN_APIKEY", sensitive: true, optional: true, description: "Mailgun apikey for your mail. Please use postmaster instead"), FastlaneCore::ConfigItem.new(key: :postmaster, env_name: "MAILGUN_SANDBOX_POSTMASTER", description: "Mailgun sandbox domain postmaster for your mail"), FastlaneCore::ConfigItem.new(key: :apikey, env_name: "MAILGUN_APIKEY", sensitive: true, description: "Mailgun apikey for your mail"), FastlaneCore::ConfigItem.new(key: :to, env_name: "MAILGUN_TO", description: "Destination of your mail"), FastlaneCore::ConfigItem.new(key: :from, env_name: "MAILGUN_FROM", optional: true, description: "Mailgun sender name", default_value: "Mailgun Sandbox"), FastlaneCore::ConfigItem.new(key: :message, env_name: "MAILGUN_MESSAGE", description: "Message of your mail"), FastlaneCore::ConfigItem.new(key: :subject, env_name: "MAILGUN_SUBJECT", description: "Subject of your mail", optional: true, default_value: "fastlane build"), FastlaneCore::ConfigItem.new(key: :success, env_name: "MAILGUN_SUCCESS", description: "Was this build successful? (true/false)", optional: true, default_value: true, type: Boolean), FastlaneCore::ConfigItem.new(key: :app_link, env_name: "MAILGUN_APP_LINK", description: "App Release link", optional: false), FastlaneCore::ConfigItem.new(key: :ci_build_link, env_name: "MAILGUN_CI_BUILD_LINK", description: "CI Build Link", optional: true), FastlaneCore::ConfigItem.new(key: :template_path, env_name: "MAILGUN_TEMPLATE_PATH", description: "Mail HTML template", optional: true), FastlaneCore::ConfigItem.new(key: :reply_to, env_name: "MAILGUN_REPLY_TO", description: "Mail Reply to", optional: true), FastlaneCore::ConfigItem.new(key: :attachment, env_name: "MAILGUN_ATTACHMENT", description: "Mail Attachment filenames, either an array or just one string", optional: true, type: Array), FastlaneCore::ConfigItem.new(key: :custom_placeholders, short_option: "-p", env_name: "MAILGUN_CUSTOM_PLACEHOLDERS", description: "Placeholders for template given as a hash", default_value: {}, type: Hash) ] end def self.author "thiagolioy" end def self.handle_params_transition(options) if options[:mailgun_sandbox_postmaster] && !options[:postmaster] options[:postmaster] = options[:mailgun_sandbox_postmaster] puts("\nUsing :mailgun_sandbox_postmaster is deprecated, please change to :postmaster".yellow) end if options[:mailgun_apikey] && !options[:apikey] options[:apikey] = options[:mailgun_apikey] puts("\nUsing :mailgun_apikey is deprecated, please change to :apikey".yellow) end end def self.mailgunit(options) sandbox_domain = options[:postmaster].split("@").last params = { from: "#{options[:from]} <#{options[:postmaster]}>", to: (options[:to]).to_s, subject: options[:subject], html: mail_template(options) } unless options[:reply_to].nil? params.store(:"h:Reply-To", options[:reply_to]) end unless options[:attachment].nil? attachment_filenames = [*options[:attachment]] attachments = attachment_filenames.map { |filename| Faraday::UploadIO.new(filename, mime_for(filename), filename) } params.store(:attachment, attachments) end conn = Faraday.new(url: "https://api:#{options[:apikey]}@api.mailgun.net") do |f| f.request(:multipart) f.request(:url_encoded) f.adapter(:net_http) end response = conn.post("/v3/#{sandbox_domain}/messages", params) UI.user_error!("Failed to send message via Mailgun, response: #{response.status}: #{response.body}.") if response.status != 200 mail_template(options) end def self.mime_for(path) mime = MIME::Types.type_for(path) mime.empty? ? 'text/plain' : mime[0].content_type end def self.mail_template(options) hash = { author: Actions.git_author_email, last_commit: Actions.last_git_commit_message, message: options[:message], app_link: options[:app_link] } hash[:success] = options[:success] hash[:ci_build_link] = options[:ci_build_link] # concatenate with custom placeholders passed by user hash = hash.merge(options[:custom_placeholders]) # grabs module eth = Fastlane::ErbTemplateHelper # create html from template html_template_path = options[:template_path] if html_template_path && File.exist?(html_template_path) html_template = eth.load_from_path(html_template_path) else html_template = eth.load("mailgun_html_template") end eth.render(html_template, hash) end def self.example_code [ 'mailgun( to: "fastlane@krausefx.com", success: true, message: "This is the mail\'s content" )', 'mailgun( postmaster: "MY_POSTMASTER", apikey: "MY_API_KEY", to: "DESTINATION_EMAIL", from: "EMAIL_FROM_NAME", reply_to: "EMAIL_REPLY_TO", success: true, message: "Mail Body", app_link: "http://www.myapplink.com", ci_build_link: "http://www.mycibuildlink.com", template_path: "HTML_TEMPLATE_PATH", custom_placeholders: { :var1 => 123, :var2 => "string" }, attachment: "dirname/filename.ext" )' ] end def self.category :notifications end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/appaloosa.rb
fastlane/lib/fastlane/actions/appaloosa.rb
module Fastlane module Actions class AppaloosaAction < Action APPALOOSA_SERVER = 'https://www.appaloosa-store.com/api/v2'.freeze def self.run(params) api_key = params[:api_token] store_id = params[:store_id] binary = params[:binary] remove_extra_screenshots_file(params[:screenshots]) binary_url = get_binary_link(binary, api_key, store_id, params[:group_ids]) return if binary_url.nil? screenshots_url = get_screenshots_links(api_key, store_id, params[:screenshots], params[:locale], params[:device]) upload_on_appaloosa(api_key, store_id, binary_url, screenshots_url, params[:group_ids], params[:description], params[:changelog]) end def self.get_binary_link(binary, api_key, store_id, group_ids) key_s3 = upload_on_s3(binary, api_key, store_id, group_ids) return if key_s3.nil? get_s3_url(api_key, store_id, key_s3) end def self.upload_on_s3(file, api_key, store_id, group_ids = '') file_name = file.split('/').last uri = URI("#{APPALOOSA_SERVER}/upload_services/presign_form") params = { file: file_name, store_id: store_id, group_ids: group_ids, api_key: api_key } uri.query = URI.encode_www_form(params) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true presign_form_response = http.request(Net::HTTP::Get.new(uri.request_uri)) json_res = JSON.parse(presign_form_response.body) return if error_detected(json_res['errors']) s3_sign = json_res['s3_sign'] path = json_res['path'] uri = URI.parse(Base64.decode64(s3_sign)) File.open(file, 'rb') do |f| http = Net::HTTP.new(uri.host) put = Net::HTTP::Put.new(uri.request_uri) put.body = f.read put['content-type'] = '' http.request(put) end path end def self.get_s3_url(api_key, store_id, path) uri = URI("#{APPALOOSA_SERVER}/#{store_id}/upload_services/url_for_download") params = { store_id: store_id, api_key: api_key, key: path } uri.query = URI.encode_www_form(params) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true url_for_download_response = http.request(Net::HTTP::Get.new(uri.request_uri)) if invalid_response?(url_for_download_response) UI.user_error!("ERROR: A problem occurred with your API token and your store id. Please try again.") end json_res = JSON.parse(url_for_download_response.body) return if error_detected(json_res['errors']) json_res['binary_url'] end def self.remove_extra_screenshots_file(screenshots_env) extra_file = "#{screenshots_env}/screenshots.html" File.unlink(extra_file) if File.exist?(extra_file) end def self.upload_screenshots(screenshots, api_key, store_id) return if screenshots.nil? list = [] list << screenshots.map do |screen| upload_on_s3(screen, api_key, store_id) end end def self.get_uploaded_links(uploaded_screenshots, api_key, store_id) return if uploaded_screenshots.nil? urls = [] urls << uploaded_screenshots.flatten.map do |url| get_s3_url(api_key, store_id, url) end end def self.get_screenshots_links(api_key, store_id, screenshots_path, locale, device) screenshots = get_screenshots(screenshots_path, locale, device) return if screenshots.nil? uploaded = upload_screenshots(screenshots, api_key, store_id) links = get_uploaded_links(uploaded, api_key, store_id) links.kind_of?(Array) ? links.flatten : nil end def self.get_screenshots(screenshots_path, locale, device) get_env_value('screenshots').nil? ? locale = '' : locale.concat('/') device.nil? ? device = '' : device.concat('-') screenshots_path.strip.empty? ? nil : screenshots_list(screenshots_path, locale, device) end def self.screenshots_list(path, locale, device) return warning_detected("screenshots folder not found") unless Dir.exist?("#{path}/#{locale}") list = Dir.entries("#{path}/#{locale}") - ['.', '..'] list.map do |screen| next if screen.match(device).nil? "#{path}/#{locale}#{screen}" unless Dir.exist?("#{path}/#{locale}#{screen}") end.compact end def self.upload_on_appaloosa(api_key, store_id, binary_path, screenshots, group_ids, description, changelog) screenshots = all_screenshots_links(screenshots) uri = URI("#{APPALOOSA_SERVER}/#{store_id}/mobile_application_updates/upload") http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true req = Net::HTTP::Post.new(uri.path, { 'Content-Type' => 'application/json' }) req.body = { store_id: store_id, api_key: api_key, mobile_application_update: { description: description, changelog: changelog, binary_path: binary_path, screenshot1: screenshots[0], screenshot2: screenshots[1], screenshot3: screenshots[2], screenshot4: screenshots[3], screenshot5: screenshots[4], group_ids: group_ids, provider: 'fastlane' } }.to_json uoa_response = http.request(req) json_res = JSON.parse(uoa_response.body) if json_res['errors'] UI.error("App: #{json_res['errors']}") else UI.success("Binary processing: Check your app': #{json_res['link']}") end end def self.all_screenshots_links(screenshots) if screenshots.nil? screens = %w(screenshot1 screenshot2 screenshot3 screenshot4 screenshot5) screenshots = screens.map do |_k, _v| '' end else missings = 5 - screenshots.count (1..missings).map do |_i| screenshots << '' end end screenshots end def self.get_env_value(option) available_options.map do |opt| opt if opt.key == option.to_sym end.compact[0].default_value end def self.error_detected(errors) if errors UI.user_error!("ERROR: #{errors}") else false end end def self.warning_detected(warning) UI.important("WARNING: #{warning}") nil end ##################################################### # @!group Documentation ##################################################### def self.description 'Upload your app to [Appaloosa Store](https://www.appaloosa-store.com/)' end def self.details [ "Appaloosa is a private mobile application store. This action offers a quick deployment on the platform.", "You can create an account, push to your existing account, or manage your user groups.", "We accept iOS and Android applications." ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :binary, env_name: 'FL_APPALOOSA_BINARY', description: 'Binary path. Optional for ipa if you use the `ipa` or `xcodebuild` action', default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH], default_value_dynamic: true, verify_block: proc do |value| UI.user_error!("Couldn't find ipa || apk file at path '#{value}'") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :api_token, env_name: 'FL_APPALOOSA_API_TOKEN', sensitive: true, description: "Your API token"), FastlaneCore::ConfigItem.new(key: :store_id, env_name: 'FL_APPALOOSA_STORE_ID', description: "Your Store id"), FastlaneCore::ConfigItem.new(key: :group_ids, env_name: 'FL_APPALOOSA_GROUPS', description: 'Your app is limited to special users? Give us the group ids', default_value: '', optional: true), FastlaneCore::ConfigItem.new(key: :screenshots, env_name: 'FL_APPALOOSA_SCREENSHOTS', description: 'Add some screenshots application to your store or hit [enter]', default_value: Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH], default_value_dynamic: true), FastlaneCore::ConfigItem.new(key: :locale, env_name: 'FL_APPALOOSA_LOCALE', description: 'Select the folder locale for your screenshots', default_value: 'en-US', optional: true), FastlaneCore::ConfigItem.new(key: :device, env_name: 'FL_APPALOOSA_DEVICE', description: 'Select the device format for your screenshots', optional: true), FastlaneCore::ConfigItem.new(key: :description, env_name: 'FL_APPALOOSA_DESCRIPTION', description: 'Your app description', optional: true), FastlaneCore::ConfigItem.new(key: :changelog, env_name: 'FL_APPALOOSA_CHANGELOG', description: 'Your app changelog', optional: true) ] end def self.authors ['Appaloosa'] end def self.is_supported?(platform) [:ios, :mac, :android].include?(platform) end def self.invalid_response?(url_for_download_response) url_for_download_response.kind_of?(Net::HTTPNotFound) || url_for_download_response.kind_of?(Net::HTTPForbidden) end def self.example_code [ "appaloosa( # Path tor your IPA or APK binary: '/path/to/binary.ipa', # You can find your store’s id at the bottom of the “Settings” page of your store store_id: 'your_store_id', # You can find your api_token at the bottom of the “Settings” page of your store api_token: 'your_api_key', # User group_ids visibility, if it's not specified we'll publish the app for all users in your store' group_ids: '112, 232, 387', # You can use fastlane/snapshot or specify your own screenshots folder. # If you use snapshot please specify a local and a device to upload your screenshots from. # When multiple values are specified in the Snapfile, we default to 'en-US' locale: 'en-US', # By default, the screenshots from the last device will be used device: 'iPhone6', # Screenshots' filenames should start with device's name like 'iphone6-s1.png' if device specified screenshots: '/path/to_your/screenshots' )" ] end def self.category :beta end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb
fastlane/lib/fastlane/actions/app_store_connect_api_key.rb
require 'base64' require 'spaceship' module Fastlane module Actions module SharedValues APP_STORE_CONNECT_API_KEY = :APP_STORE_CONNECT_API_KEY end class AppStoreConnectApiKeyAction < Action def self.run(options) key_id = options[:key_id] issuer_id = options[:issuer_id] key_content = options[:key_content] is_key_content_base64 = options[:is_key_content_base64] key_filepath = options[:key_filepath] duration = options[:duration] in_house = options[:in_house] if key_content.nil? && key_filepath.nil? UI.user_error!(":key_content or :key_filepath is required") end # New lines don't get read properly when coming from an ENV # Replacing them literal version with a new line key_content = key_content.gsub('\n', "\n") if key_content # This hash matches the named arguments on # the Spaceship::ConnectAPI::Token.create method key = { key_id: key_id, issuer_id: issuer_id, key: key_content || File.binread(File.expand_path(key_filepath)), is_key_content_base64: is_key_content_base64, duration: duration, in_house: in_house } Actions.lane_context.set_sensitive(SharedValues::APP_STORE_CONNECT_API_KEY, key) # Creates Spaceship API Key session # User does not need to pass the token into any actions because of this Spaceship::ConnectAPI.token = Spaceship::ConnectAPI::Token.create(**key) if options[:set_spaceship_token] return key end def self.description "Load the App Store Connect API token to use in other fastlane tools and actions" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :key_id, env_name: "APP_STORE_CONNECT_API_KEY_KEY_ID", description: "The key ID"), FastlaneCore::ConfigItem.new(key: :issuer_id, env_name: "APP_STORE_CONNECT_API_KEY_ISSUER_ID", description: "The issuer ID. It can be nil if the key is individual API key", optional: true), FastlaneCore::ConfigItem.new(key: :key_filepath, env_name: "APP_STORE_CONNECT_API_KEY_KEY_FILEPATH", description: "The path to the key p8 file", optional: true, conflicting_options: [:key_content], verify_block: proc do |value| UI.user_error!("Couldn't find key p8 file at path '#{value}'") unless File.exist?(File.expand_path(value)) end), FastlaneCore::ConfigItem.new(key: :key_content, env_name: "APP_STORE_CONNECT_API_KEY_KEY", description: "The content of the key p8 file", sensitive: true, optional: true, conflicting_options: [:filepath]), FastlaneCore::ConfigItem.new(key: :is_key_content_base64, env_name: "APP_STORE_CONNECT_API_KEY_IS_KEY_CONTENT_BASE64", description: "Whether :key_content is Base64 encoded or not", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :duration, env_name: "APP_STORE_CONNECT_API_KEY_DURATION", description: "The token session duration", optional: true, default_value: Spaceship::ConnectAPI::Token::DEFAULT_TOKEN_DURATION, type: Integer, verify_block: proc do |value| UI.user_error!("The duration can't be more than 1200 (20 minutes) and the value entered was '#{value}'") unless value <= 1200 end), FastlaneCore::ConfigItem.new(key: :in_house, env_name: "APP_STORE_CONNECT_API_KEY_IN_HOUSE", description: "Is App Store or Enterprise (in house) team? App Store Connect API cannot determine this on its own (yet)", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :set_spaceship_token, env_name: "APP_STORE_CONNECT_API_KEY_SET_SPACESHIP_TOKEN", description: "Authorizes all Spaceship::ConnectAPI requests by automatically setting Spaceship::ConnectAPI.token", type: Boolean, default_value: true) ] end def self.output [ ['APP_STORE_CONNECT_API_KEY', 'The App Store Connect API key information used for authorization requests. This hash can be passed directly into the :api_key options on other tools or into Spaceship::ConnectAPI::Token.create method'] ] end def self.author ["joshdholtz"] end def self.is_supported?(platform) [:ios, :mac, :tvos].include?(platform) end def self.details [ "Load the App Store Connect API token to use in other fastlane tools and actions" ].join("\n") end def self.example_code [ 'app_store_connect_api_key( key_id: "D83848D23", issuer_id: "227b0bbf-ada8-458c-9d62-3d8022b7d07f", key_filepath: "D83848D23.p8" )', 'app_store_connect_api_key( key_id: "D83848D23", issuer_id: "227b0bbf-ada8-458c-9d62-3d8022b7d07f", key_filepath: "D83848D23.p8", duration: 200, in_house: true )', 'app_store_connect_api_key( key_id: "D83848D23", issuer_id: "227b0bbf-ada8-458c-9d62-3d8022b7d07f", key_content: "-----BEGIN EC PRIVATE KEY-----\nfewfawefawfe\n-----END EC PRIVATE KEY-----" )' ] end def self.category :app_store_connect end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/upload_symbols_to_sentry.rb
fastlane/lib/fastlane/actions/upload_symbols_to_sentry.rb
module Fastlane module Actions class UploadSymbolsToSentryAction < Action def self.run(params) # Warning about using new plugin UI.important("It's recommended to use the official Sentry Fastlane plugin") UI.important("GitHub: https://github.com/getsentry/fastlane-plugin-sentry") UI.important("Installation: fastlane add_plugin sentry") UI.user_error!("This plugin is now completely deprecated") # the code below doesn't run anymore # Actions.verify_gem!('rest-client') # require 'rest-client' # Params - API host = params[:api_host] api_key = params[:api_key] auth_token = params[:auth_token] org = params[:org_slug] project = params[:project_slug] # Params - dSYM dsym_path = params[:dsym_path] dsym_paths = params[:dsym_paths] || [] has_api_key = !api_key.to_s.empty? has_auth_token = !auth_token.to_s.empty? # Will fail if none or both authentication methods are provided if !has_api_key && !has_auth_token UI.user_error!("No API key or authentication token found for SentryAction given, pass using `api_key: 'key'` or `auth_token: 'token'`") elsif has_api_key && has_auth_token UI.user_error!("Both API key and authentication token found for SentryAction given, please only give one") end # Url to post dSYMs to url = "#{host}/projects/#{org}/#{project}/files/dsyms/" if has_api_key resource = RestClient::Resource.new(url, api_key, '') else resource = RestClient::Resource.new(url, headers: { Authorization: "Bearer #{auth_token}" }) end UI.message("Will upload dSYM(s) to #{url}") # Upload dsym(s) dsym_paths += [dsym_path] uploaded_paths = dsym_paths.compact.map do |dsym| upload_dsym(resource, dsym) end # Return uploaded dSYM paths uploaded_paths end def self.upload_dsym(resource, dsym) UI.message("Uploading... #{dsym}") resource.post(file: File.new(dsym, 'rb')) unless Helper.test? UI.success('dSYM successfully uploaded to Sentry!') dsym rescue UI.user_error!('Error while trying to upload dSYM to Sentry') end ##################################################### # @!group Documentation ##################################################### def self.description "Upload dSYM symbolication files to Sentry" end def self.details "This action allows you to upload symbolication files to Sentry. It's extra useful if you use it to download the latest dSYM files from Apple when you use Bitcode." end def self.available_options [ FastlaneCore::ConfigItem.new(key: :api_host, env_name: "SENTRY_HOST", description: "API host url for Sentry", default_value: "https://app.getsentry.com/api/0", optional: true), FastlaneCore::ConfigItem.new(key: :api_key, env_name: "SENTRY_API_KEY", description: "API key for Sentry", sensitive: true, optional: true), FastlaneCore::ConfigItem.new(key: :auth_token, env_name: "SENTRY_AUTH_TOKEN", description: "Authentication token for Sentry", sensitive: true, optional: true), FastlaneCore::ConfigItem.new(key: :org_slug, env_name: "SENTRY_ORG_SLUG", description: "Organization slug for Sentry project", verify_block: proc do |value| UI.user_error!("No organization slug for SentryAction given, pass using `org_slug: 'org'`") unless value && !value.empty? end), FastlaneCore::ConfigItem.new(key: :project_slug, env_name: "SENTRY_PROJECT_SLUG", description: "Project slug for Sentry", verify_block: proc do |value| UI.user_error!("No project slug for SentryAction given, pass using `project_slug: 'project'`") unless value && !value.empty? end), FastlaneCore::ConfigItem.new(key: :dsym_path, env_name: "SENTRY_DSYM_PATH", description: "Path to your symbols file. For iOS and Mac provide path to app.dSYM.zip", default_value: Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH], default_value_dynamic: true, optional: true), FastlaneCore::ConfigItem.new(key: :dsym_paths, env_name: "SENTRY_DSYM_PATHS", description: "Path to an array of your symbols file. For iOS and Mac provide path to app.dSYM.zip", default_value: Actions.lane_context[SharedValues::DSYM_PATHS], default_value_dynamic: true, type: Array, optional: true) ] end def self.return_value "The uploaded dSYM path(s)" end def self.authors ["joshdholtz"] end def self.is_supported?(platform) platform == :ios end def self.example_code [ 'upload_symbols_to_sentry( auth_token: "...", org_slug: "...", project_slug: "...", dsym_path: "./App.dSYM.zip" )' ] end def self.category :deprecated end def self.deprecated_notes [ "Please use the `sentry` plugin instead.", "Install using `fastlane add_plugin sentry`.", "Replace `upload_symbols_to_sentry(...)` with `sentry_upload_dsym(...)`." ].join("\n") end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/xcodes.rb
fastlane/lib/fastlane/actions/xcodes.rb
module Fastlane module Actions module SharedValues XCODES_XCODE_PATH = :XCODES_XCODE_PATH end class XcodesAction < Action def self.run(params) binary = params[:binary_path] xcodes_raw_version = Actions.sh("#{binary} version", log: false) xcodes_version = Gem::Version.new(xcodes_raw_version) UI.message("Running xcodes version #{xcodes_version}") if xcodes_version < Gem::Version.new("1.1.0") UI.user_error!([ "xcodes action requires the minimum version of xcodes binary to be v1.1.0.", "Please update xcodes. If you installed it via Homebrew, this can be done via 'brew upgrade xcodes'" ].join(" ")) end version = params[:version] command = [] command << binary if (xcodes_args = params[:xcodes_args]) command << xcodes_args Actions.sh(command.join(" ")) elsif !params[:select_for_current_build_only] command << "install" command << "'#{version}'" command << "--update" if params[:update_list] command << "--select" Actions.sh(command.join(" ")) end command = [] command << binary command << "installed" command << "'#{version}'" # `installed <version>` will either return the path to the given # version or fail because the version can't be found. # # Store the path if we get one, fail the action otherwise. xcode_path = Actions.sh(command.join(" ")) do |status, result, sh_command| formatted_result = result.chomp unless status.success? UI.user_error!("Command `#{sh_command}` failed with status #{status.exitstatus} and message: #{formatted_result}") end formatted_result end # If the command succeeded, `xcode_path` will be something like: # /Applications/Xcode-14.app xcode_developer_path = File.join(xcode_path, "/Contents/Developer") UI.message("Setting Xcode version '#{version}' at '#{xcode_path}' for all build steps") ENV["DEVELOPER_DIR"] = xcode_developer_path Actions.lane_context[SharedValues::XCODES_XCODE_PATH] = xcode_developer_path return xcode_path end ##################################################### # @!group Documentation ##################################################### def self.description "Make sure a certain version of Xcode is installed, installing it only if needed" end def self.details [ "Makes sure a specific version of Xcode is installed. If that's not the case, it will automatically be downloaded by [xcodes](https://github.com/RobotsAndPencils/xcodes).", "This will make sure to use the correct Xcode version for later actions.", "Note that this action depends on [xcodes](https://github.com/RobotsAndPencils/xcodes) CLI, so make sure you have it installed in your environment. For the installation guide, see: https://github.com/RobotsAndPencils/xcodes#installation" ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :version, env_name: "FL_XCODE_VERSION", description: "The version number of the version of Xcode to install. Defaults to the value specified in the .xcode-version file", default_value: Helper::XcodesHelper.read_xcode_version_file, default_value_dynamic: true, verify_block: Helper::XcodesHelper::Verify.method(:requirement)), FastlaneCore::ConfigItem.new(key: :update_list, env_name: "FL_XCODES_UPDATE_LIST", description: "Whether the list of available Xcode versions should be updated before running the install command", type: Boolean, default_value: true), FastlaneCore::ConfigItem.new(key: :select_for_current_build_only, env_name: "FL_XCODES_SELECT_FOR_CURRENT_BUILD_ONLY", description: [ "When true, it won't attempt to install an Xcode version, just find the installed Xcode version that best matches the passed version argument, and select it for the current build steps.", "It doesn't change the global Xcode version (e.g. via 'xcrun xcode-select'), which would require sudo permissions — when this option is true, this action doesn't require sudo permissions" ].join(" "), type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :binary_path, env_name: "FL_XCODES_BINARY_PATH", description: "Where the xcodes binary lives on your system (full path)", default_value: Helper::XcodesHelper.find_xcodes_binary_path, default_value_dynamic: true, verify_block: proc do |value| UI.user_error!("'xcodes' doesn't seem to be installed. Please follow the installation guide at https://github.com/RobotsAndPencils/xcodes#installation before proceeding") if value.empty? UI.user_error!("Couldn't find xcodes binary at path '#{value}'") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :xcodes_args, env_name: "FL_XCODES_ARGS", description: "Pass in xcodes command line arguments directly. When present, other parameters are ignored and only this parameter is used to build the command to be executed", type: :shell_string, optional: true) ] end def self.output [ ['XCODES_XCODE_PATH', 'The path to the newly installed Xcode version'] ] end def self.return_value "The path to the newly installed Xcode version" end def self.return_type :string end def self.authors ["rogerluan"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'xcodes(version: "14.1")', 'xcodes # When missing, the version value defaults to the value specified in the .xcode-version file' ] end def self.category :building end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/lane_context.rb
fastlane/lib/fastlane/actions/lane_context.rb
module Fastlane module Actions class LaneContextAction < Action def self.run(params) Actions.lane_context end ##################################################### # @!group Documentation ##################################################### def self.description "Access lane context values" end def self.details [ "Access the fastlane lane context values.", "More information about how the lane context works: [https://docs.fastlane.tools/advanced/#lane-context](https://docs.fastlane.tools/advanced/#lane-context)." ].join("\n") end def self.available_options [] end def self.output [] end def self.return_type :hash end def self.authors ["KrauseFx"] end def self.is_supported?(platform) true end # We don't want to show this as step def self.step_text nil end def self.example_code [ 'lane_context[SharedValues::BUILD_NUMBER]', 'lane_context[SharedValues::IPA_OUTPUT_PATH]' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/match.rb
fastlane/lib/fastlane/actions/match.rb
module Fastlane module Actions require 'fastlane/actions/sync_code_signing' class MatchAction < SyncCodeSigningAction ##################################################### # @!group Documentation ##################################################### def self.description "Alias for the `sync_code_signing` action" end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/build_mac_app.rb
fastlane/lib/fastlane/actions/build_mac_app.rb
module Fastlane module Actions require 'fastlane/actions/build_app' class BuildMacAppAction < BuildAppAction # Gym::Options.available_options keys that don't apply to mac apps. REJECT_OPTIONS = [ :ipa, :skip_package_ipa, :catalyst_platform ] def self.run(params) # Adding reject options back in so gym has everything it needs params.available_options += Gym::Options.available_options.select do |option| REJECT_OPTIONS.include?(option.key) end # Defaulting to mac specific values params[:catalyst_platform] = "macos" super(params) end ##################################################### # @!group Documentation ##################################################### def self.available_options require 'gym' require 'gym/options' Gym::Options.available_options.reject do |option| REJECT_OPTIONS.include?(option.key) end end def self.is_supported?(platform) [:mac].include?(platform) end def self.description "Alias for the `build_app` action but only for macOS" end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/backup_file.rb
fastlane/lib/fastlane/actions/backup_file.rb
module Fastlane module Actions class BackupFileAction < Action def self.run(params) path = params[:path] FileUtils.cp(path, "#{path}.back", preserve: true) UI.message("Successfully created a backup 💾") end def self.description 'This action backs up your file to "[path].back"' end def self.is_supported?(platform) true end def self.author "gin0606" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :path, description: "Path to the file you want to backup", optional: false) ] end def self.example_code [ 'backup_file(path: "/path/to/file")' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/get_github_release.rb
fastlane/lib/fastlane/actions/get_github_release.rb
module Fastlane module Actions module SharedValues GET_GITHUB_RELEASE_INFO = :GET_GITHUB_RELEASE_INFO end class GetGithubReleaseAction < Action def self.run(params) UI.message("Getting release on GitHub (#{params[:server_url]}/#{params[:url]}: #{params[:version]})") GithubApiAction.run( server_url: params[:server_url], api_token: params[:api_token], api_bearer: params[:api_bearer], http_method: 'GET', path: "repos/#{params[:url]}/releases", error_handlers: { 404 => proc do |result| UI.error("Repository #{params[:url]} cannot be found, please double check its name and that you provided a valid API token (if it's a private repository).") return nil end, 401 => proc do |result| UI.error("You are not authorized to access #{params[:url]}, please make sure you provided a valid API token.") return nil end, '*' => proc do |result| UI.error("GitHub responded with #{result[:status]}:#{result[:body]}") return nil end } ) do |result| json = result[:json] json.each do |current| next unless current['tag_name'] == params[:version] # Found it Actions.lane_context[SharedValues::GET_GITHUB_RELEASE_INFO] = current UI.message("Version is already live on GitHub.com 🚁") return current end end UI.important("Couldn't find GitHub release #{params[:version]}") return nil end ##################################################### # @!group Documentation ##################################################### def self.description "This will verify if a given release version is available on GitHub" end def self.details sample = <<-SAMPLE.markdown_sample ```no-highlight { "url"=>"https://api.github.com/repos/KrauseFx/fastlane/releases/1537713", "assets_url"=>"https://api.github.com/repos/KrauseFx/fastlane/releases/1537713/assets", "upload_url"=>"https://uploads.github.com/repos/KrauseFx/fastlane/releases/1537713/assets{?name}", "html_url"=>"https://github.com/fastlane/fastlane/releases/tag/1.8.0", "id"=>1537713, "tag_name"=>"1.8.0", "target_commitish"=>"master", "name"=>"1.8.0 Switch Lanes & Pass Parameters", "draft"=>false, "author"=> {"login"=>"KrauseFx", "id"=>869950, "avatar_url"=>"https://avatars.githubusercontent.com/u/869950?v=3", "gravatar_id"=>"", "url"=>"https://api.github.com/users/KrauseFx", "html_url"=>"https://github.com/fastlane", "followers_url"=>"https://api.github.com/users/KrauseFx/followers", "following_url"=>"https://api.github.com/users/KrauseFx/following{/other_user}", "gists_url"=>"https://api.github.com/users/KrauseFx/gists{/gist_id}", "starred_url"=>"https://api.github.com/users/KrauseFx/starred{/owner}{/repo}", "subscriptions_url"=>"https://api.github.com/users/KrauseFx/subscriptions", "organizations_url"=>"https://api.github.com/users/KrauseFx/orgs", "repos_url"=>"https://api.github.com/users/KrauseFx/repos", "events_url"=>"https://api.github.com/users/KrauseFx/events{/privacy}", "received_events_url"=>"https://api.github.com/users/KrauseFx/received_events", "type"=>"User", "site_admin"=>false}, "prerelease"=>false, "created_at"=>"2015-07-14T23:33:01Z", "published_at"=>"2015-07-14T23:44:10Z", "assets"=>[], "tarball_url"=>"https://api.github.com/repos/KrauseFx/fastlane/tarball/1.8.0", "zipball_url"=>"https://api.github.com/repos/KrauseFx/fastlane/zipball/1.8.0", "body"=> ...Markdown... "This is one of the biggest updates of _fastlane_ yet" } ``` SAMPLE [ "This will return all information about a release. For example:".markdown_preserve_newlines, sample ].join("\n") end def self.output [ ['GET_GITHUB_RELEASE_INFO', 'Contains all the information about this release'] ] end def self.available_options [ FastlaneCore::ConfigItem.new(key: :url, env_name: "FL_GET_GITHUB_RELEASE_URL", description: "The path to your repo, e.g. 'KrauseFx/fastlane'", verify_block: proc do |value| UI.user_error!("Please only pass the path, e.g. 'KrauseFx/fastlane'") if value.include?("github.com") UI.user_error!("Please only pass the path, e.g. 'KrauseFx/fastlane'") if value.split('/').count != 2 end), FastlaneCore::ConfigItem.new(key: :server_url, env_name: "FL_GITHUB_RELEASE_SERVER_URL", description: "The server url. e.g. 'https://your.github.server/api/v3' (Default: 'https://api.github.com')", default_value: "https://api.github.com", optional: true, verify_block: proc do |value| UI.user_error!("Please include the protocol in the server url, e.g. https://your.github.server") unless value.include?("//") end), FastlaneCore::ConfigItem.new(key: :version, env_name: "FL_GET_GITHUB_RELEASE_VERSION", description: "The version tag of the release to check"), FastlaneCore::ConfigItem.new(key: :api_token, env_name: "FL_GITHUB_RELEASE_API_TOKEN", sensitive: true, code_gen_sensitive: true, default_value: ENV["GITHUB_API_TOKEN"], default_value_dynamic: true, description: "GitHub Personal Token (required for private repositories)", conflicting_options: [:api_bearer], optional: true), FastlaneCore::ConfigItem.new(key: :api_bearer, env_name: "FL_GITHUB_RELEASE_API_BEARER", sensitive: true, code_gen_sensitive: true, description: "Use a Bearer authorization token. Usually generated by GitHub Apps, e.g. GitHub Actions GITHUB_TOKEN environment variable", conflicting_options: [:api_token], optional: true, default_value: nil) ] end def self.authors ["KrauseFx", "czechboy0", "jaleksynas", "tommeier"] end def self.is_supported?(platform) true end def self.example_code [ 'release = get_github_release(url: "fastlane/fastlane", version: "1.0.0") puts release["name"]' ] end def self.sample_return_value { "name" => "name" } end def self.category :source_control end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/xctool.rb
fastlane/lib/fastlane/actions/xctool.rb
module Fastlane module Actions class XctoolAction < Action def self.run(params) UI.important("Have you seen the new 'scan' tool to run tests? https://docs.fastlane.tools/actions/scan/") unless Helper.test? UI.user_error!("xctool not installed, please install using `brew install xctool`") if `which xctool`.length == 0 end params = [] if params.kind_of?(FastlaneCore::Configuration) Actions.sh('xctool ' + params.join(' ')) end def self.description "Run tests using xctool" end def self.details [ "You can run any `xctool` action. This will require having [xctool](https://github.com/facebook/xctool) installed through [Homebrew](http://brew.sh).", "It is recommended to store the build configuration in the `.xctool-args` file.", "More information: [https://docs.fastlane.tools/actions/xctool/](https://docs.fastlane.tools/actions/xctool/)." ].join("\n") end def self.author "KrauseFx" end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'xctool(:test)', '# If you prefer to have the build configuration stored in the `Fastfile`: xctool(:test, [ "--workspace", "\'AwesomeApp.xcworkspace\'", "--scheme", "\'Schema Name\'", "--configuration", "Debug", "--sdk", "iphonesimulator", "--arch", "i386" ].join(" "))' ] end def self.category :testing end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/rocket.rb
fastlane/lib/fastlane/actions/rocket.rb
module Fastlane module Actions class RocketAction < Action def self.run(params) puts(" ____ / \\ | | | | | | \\____/ | | | | | | |____| {| |} | | | | | F | | A | | S | | T | | L | | A | /| N |\\ || E || || || \\|____|/ /_\\/_\\ ###### ######## ###### #### #### ## ## ## ## ") return "🚀" end ##################################################### # @!group Documentation ##################################################### def self.description "Outputs ascii-art for a rocket 🚀" end def self.details "Print an ascii Rocket :rocket:. Useful after using _crashlytics_ or _pilot_ to indicate that your new build has been shipped to outer-space." end def self.available_options [ ] end def self.authors ["JaviSoto", "radex"] end def self.is_supported?(platform) true end def self.example_code [ 'rocket' ] end def self.return_type :string end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/copy_artifacts.rb
fastlane/lib/fastlane/actions/copy_artifacts.rb
require 'fileutils' module Fastlane module Actions class CopyArtifactsAction < Action def self.run(params) # expand the path to make sure we can deal with relative paths target_path = File.expand_path(params[:target_path]) # we want to make sure that our target folder exist already FileUtils.mkdir_p(target_path) # Ensure that artifacts is an array artifacts_to_search = [params[:artifacts]].flatten # If any of the paths include "*", we assume that we are referring to the Unix entries # e.g /tmp/fastlane/* refers to all the files in /tmp/fastlane # We use Dir.glob to expand all those paths, this would create an array of arrays though, so flatten artifacts = artifacts_to_search.flat_map { |f| f.include?("*") ? Dir.glob(f) : f } UI.verbose("Copying artifacts #{artifacts.join(', ')} to #{target_path}") UI.verbose(params[:keep_original] ? "Keeping original files" : "Not keeping original files") if params[:fail_on_missing] missing = artifacts.reject { |a| File.exist?(a) } UI.user_error!("Not all files were present in copy artifacts. Missing #{missing.join(', ')}") unless missing.empty? else # If we don't fail on nonexistent files, don't try to copy nonexistent files artifacts.select! { |artifact| File.exist?(artifact) } end if params[:keep_original] FileUtils.cp_r(artifacts, target_path, remove_destination: true) else FileUtils.mv(artifacts, target_path, force: true) end UI.success('Build artifacts successfully copied!') end ##################################################### # @!group Documentation ##################################################### def self.description "Copy and save your build artifacts (useful when you use reset_git_repo)" end def self.details [ "This action copies artifacts to a target directory. It's useful if you have a CI that will pick up these artifacts and attach them to the build. Useful e.g. for storing your `.ipa`s, `.dSYM.zip`s, `.mobileprovision`s, `.cert`s.", "Make sure your `:target_path` is ignored from git, and if you use `reset_git_repo`, make sure the artifacts are added to the exclude list." ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :keep_original, description: "Set this to false if you want move, rather than copy, the found artifacts", type: Boolean, optional: true, default_value: true), FastlaneCore::ConfigItem.new(key: :target_path, description: "The directory in which you want your artifacts placed", optional: false, default_value: 'artifacts'), FastlaneCore::ConfigItem.new(key: :artifacts, description: "An array of file patterns of the files/folders you want to preserve", type: Array, optional: false, default_value: []), FastlaneCore::ConfigItem.new(key: :fail_on_missing, description: "Fail when a source file isn't found", type: Boolean, optional: true, default_value: false) ] end def self.authors ["lmirosevic"] end def self.is_supported?(platform) true end def self.example_code [ 'copy_artifacts( target_path: "artifacts", artifacts: ["*.cer", "*.mobileprovision", "*.ipa", "*.dSYM.zip", "path/to/file.txt", "another/path/*.extension"] ) # Reset the git repo to a clean state, but leave our artifacts in place reset_git_repo( exclude: "artifacts" )', '# Copy the .ipa created by _gym_ if it was successfully created artifacts = [] artifacts << lane_context[SharedValues::IPA_OUTPUT_PATH] if lane_context[SharedValues::IPA_OUTPUT_PATH] copy_artifacts( artifacts: artifacts )' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/pod_push.rb
fastlane/lib/fastlane/actions/pod_push.rb
module Fastlane module Actions class PodPushAction < Action def self.run(params) command = [] command << "bundle exec" if params[:use_bundle_exec] && shell_out_should_use_bundle_exec? if params[:repo] repo = params[:repo] command << "pod repo push #{repo}" else command << 'pod trunk push' end if params[:path] command << "'#{params[:path]}'" end if params[:sources] sources = params[:sources].join(",") command << "--sources='#{sources}'" end if params[:swift_version] swift_version = params[:swift_version] command << "--swift-version=#{swift_version}" end if params[:allow_warnings] command << "--allow-warnings" end if params[:use_libraries] command << "--use-libraries" end if params[:skip_import_validation] command << "--skip-import-validation" end if params[:skip_tests] command << "--skip-tests" end if params[:use_json] command << "--use-json" end if params[:verbose] command << "--verbose" end if params[:use_modular_headers] command << "--use-modular-headers" end if params[:synchronous] command << "--synchronous" end if params[:no_overwrite] command << "--no-overwrite" end if params[:local_only] command << "--local-only" end result = Actions.sh(command.join(' ')) UI.success("Successfully pushed Podspec ⬆️ ") return result end ##################################################### # @!group Documentation ##################################################### def self.description "Push a Podspec to Trunk or a private repository" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :use_bundle_exec, description: "Use bundle exec when there is a Gemfile presented", type: Boolean, default_value: false, env_name: "FL_POD_PUSH_USE_BUNDLE_EXEC"), FastlaneCore::ConfigItem.new(key: :path, description: "The Podspec you want to push", optional: true, verify_block: proc do |value| UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value) UI.user_error!("File must be a `.podspec` or `.podspec.json`") unless value.end_with?(".podspec", ".podspec.json") end, env_name: "FL_POD_PUSH_PATH"), FastlaneCore::ConfigItem.new(key: :repo, description: "The repo you want to push. Pushes to Trunk by default", optional: true, env_name: "FL_POD_PUSH_REPO"), FastlaneCore::ConfigItem.new(key: :allow_warnings, description: "Allow warnings during pod push", optional: true, type: Boolean, env_name: "FL_POD_PUSH_ALLOW_WARNINGS"), FastlaneCore::ConfigItem.new(key: :use_libraries, description: "Allow lint to use static libraries to install the spec", optional: true, type: Boolean, env_name: "FL_POD_PUSH_USE_LIBRARIES"), FastlaneCore::ConfigItem.new(key: :sources, description: "The sources of repos you want the pod spec to lint with, separated by commas", optional: true, type: Array, verify_block: proc do |value| UI.user_error!("Sources must be an array.") unless value.kind_of?(Array) end, env_name: "FL_POD_PUSH_SOURCES"), FastlaneCore::ConfigItem.new(key: :swift_version, description: "The SWIFT_VERSION that should be used to lint the spec. This takes precedence over a .swift-version file", optional: true, env_name: "FL_POD_PUSH_SWIFT_VERSION"), FastlaneCore::ConfigItem.new(key: :skip_import_validation, description: "Lint skips validating that the pod can be imported", optional: true, type: Boolean, env_name: "FL_POD_PUSH_SKIP_IMPORT_VALIDATION"), FastlaneCore::ConfigItem.new(key: :skip_tests, description: "Lint skips building and running tests during validation", optional: true, type: Boolean, env_name: "FL_POD_PUSH_SKIP_TESTS"), FastlaneCore::ConfigItem.new(key: :use_json, description: "Convert the podspec to JSON before pushing it to the repo", optional: true, type: Boolean, env_name: "FL_POD_PUSH_USE_JSON"), FastlaneCore::ConfigItem.new(key: :verbose, description: "Show more debugging information", optional: true, type: Boolean, default_value: false, env_name: "FL_POD_PUSH_VERBOSE"), FastlaneCore::ConfigItem.new(key: :use_modular_headers, description: "Use modular headers option during validation", optional: true, type: Boolean, env_name: "FL_POD_PUSH_USE_MODULAR_HEADERS"), FastlaneCore::ConfigItem.new(key: :synchronous, description: "If validation depends on other recently pushed pods, synchronize", optional: true, type: Boolean, env_name: "FL_POD_PUSH_SYNCHRONOUS"), FastlaneCore::ConfigItem.new(key: :no_overwrite, description: "Disallow pushing that would overwrite an existing spec", optional: true, type: Boolean, env_name: "FL_POD_PUSH_NO_OVERWRITE"), FastlaneCore::ConfigItem.new(key: :local_only, description: "Does not perform the step of pushing REPO to its remote", optional: true, type: Boolean, env_name: "FL_POD_PUSH_LOCAL_ONLY") ] end def self.return_value nil end def self.authors ["squarefrog"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ '# If no path is supplied then Trunk will attempt to find the first Podspec in the current directory. pod_push', '# Alternatively, supply the Podspec file path pod_push(path: "TSMessages.podspec")', '# You may also push to a private repo instead of Trunk pod_push(path: "TSMessages.podspec", repo: "MyRepo")', '# If the podspec has a dependency on another private pod, then you will have to supply the sources you want the podspec to lint with for pod_push to succeed. Read more here - https://github.com/CocoaPods/CocoaPods/issues/2543. pod_push(path: "TMessages.podspec", repo: "MyRepo", sources: ["https://github.com/username/Specs", "https://github.com/CocoaPods/Specs"])' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/scp.rb
fastlane/lib/fastlane/actions/scp.rb
module Fastlane module Actions module SharedValues end class ScpAction < Action def self.run(params) Actions.verify_gem!('net-scp') require "net/scp" ret = nil Net::SCP.start(params[:host], params[:username], { port: params[:port].to_i, password: params[:password] }) do |scp| if params[:upload] scp.upload!(params[:upload][:src], params[:upload][:dst], recursive: true) UI.message(['[SCP COMMAND]', "Successfully Uploaded", params[:upload][:src], params[:upload][:dst]].join(': ')) end if params[:download] t_ret = scp.download!(params[:download][:src], params[:download][:dst], recursive: true) UI.message(['[SCP COMMAND]', "Successfully Downloaded", params[:download][:src], params[:download][:dst]].join(': ')) unless params[:download][:dst] ret = t_ret end end end ret end ##################################################### # @!group Documentation ##################################################### def self.description "Transfer files via SCP" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :username, short_option: "-u", env_name: "FL_SSH_USERNAME", description: "Username"), FastlaneCore::ConfigItem.new(key: :password, short_option: "-p", env_name: "FL_SSH_PASSWORD", description: "Password", sensitive: true, optional: true), FastlaneCore::ConfigItem.new(key: :host, short_option: "-H", env_name: "FL_SSH_HOST", description: "Hostname"), FastlaneCore::ConfigItem.new(key: :port, short_option: "-P", env_name: "FL_SSH_PORT", description: "Port", optional: true, default_value: "22"), FastlaneCore::ConfigItem.new(key: :upload, short_option: "-U", env_name: "FL_SCP_UPLOAD", description: "Upload", optional: true, type: Hash), FastlaneCore::ConfigItem.new(key: :download, short_option: "-D", env_name: "FL_SCP_DOWNLOAD", description: "Download", optional: true, type: Hash) ] end def self.authors ["hjanuschka"] end def self.is_supported?(platform) true end def self.example_code [ 'scp( host: "dev.januschka.com", username: "root", upload: { src: "/root/dir1", dst: "/tmp/new_dir" } )', 'scp( host: "dev.januschka.com", username: "root", download: { src: "/root/dir1", dst: "/tmp/new_dir" } )' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/adb.rb
fastlane/lib/fastlane/actions/adb.rb
module Fastlane module Actions module SharedValues end class AdbAction < Action def self.run(params) adb = Helper::AdbHelper.new(adb_path: params[:adb_path]) result = adb.trigger(command: params[:command], serial: params[:serial]) return result end ##################################################### # @!group Documentation ##################################################### def self.description "Run ADB Actions" end def self.details "see adb --help for more details" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :serial, env_name: "FL_ANDROID_SERIAL", description: "Android serial of the device to use for this command", default_value: ""), FastlaneCore::ConfigItem.new(key: :command, env_name: "FL_ADB_COMMAND", description: "All commands you want to pass to the adb command, e.g. `kill-server`", optional: true), FastlaneCore::ConfigItem.new(key: :adb_path, env_name: "FL_ADB_PATH", optional: true, description: "The path to your `adb` binary (can be left blank if the ANDROID_SDK_ROOT, ANDROID_HOME or ANDROID_SDK environment variable is set)", default_value: "adb") ] end def self.output end def self.category :building end def self.example_code [ 'adb( command: "shell ls" )' ] end def self.return_value "The output of the adb command" end def self.return_type :string end def self.authors ["hjanuschka"] end def self.is_supported?(platform) platform == :android end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/jazzy.rb
fastlane/lib/fastlane/actions/jazzy.rb
module Fastlane module Actions class JazzyAction < Action def self.run(params) Actions.verify_gem!('jazzy') command = "jazzy" command << " --config #{params[:config]}" if params[:config] command << " --module-version #{params[:module_version]}" if params[:module_version] Actions.sh(command) end ##################################################### # @!group Documentation ##################################################### def self.description "Generate docs using Jazzy" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :config, env_name: 'FL_JAZZY_CONFIG', description: 'Path to jazzy config file', optional: true), FastlaneCore::ConfigItem.new(key: :module_version, env_name: 'FL_JAZZY_MODULE_VERSION', description: 'Version string to use as part of the default docs title and inside the docset', optional: true) ] end def self.output end def self.return_value end def self.authors ["KrauseFx"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'jazzy', 'jazzy(config: ".jazzy.yaml", module_version: "2.1.37")' ] end def self.category :documentation end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/setup_circle_ci.rb
fastlane/lib/fastlane/actions/setup_circle_ci.rb
module Fastlane module Actions class SetupCircleCiAction < Action def self.run(params) other_action.setup_ci(provider: "circleci", force: params[:force]) end ##################################################### # @!group Documentation ##################################################### def self.description "Setup the keychain and match to work with CircleCI" end def self.details list = <<-LIST.markdown_list(true) Creates a new temporary keychain for use with match Switches match to `readonly` mode to not create new profiles/cert on CI Sets up log and test result paths to be easily collectible LIST [ list, "This action helps with CircleCI integration. Add this to the top of your Fastfile if you use CircleCI." ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :force, env_name: "FL_SETUP_CIRCLECI_FORCE", description: "Force setup, even if not executed by CircleCI", type: Boolean, default_value: false) ] end def self.authors ["dantoml"] end def self.is_supported?(platform) true end def self.example_code [ 'setup_circle_ci' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/resign.rb
fastlane/lib/fastlane/actions/resign.rb
module Fastlane module Actions # Resigns the ipa class ResignAction < Action def self.run(params) require 'sigh' # try to resign the ipa if Sigh::Resign.resign(params[:ipa], params[:signing_identity], params[:provisioning_profile], params[:entitlements], params[:version], params[:display_name], params[:short_version], params[:bundle_version], params[:bundle_id], params[:use_app_entitlements], params[:keychain_path]) UI.success('Successfully re-signed .ipa 🔏.') else UI.user_error!("Failed to re-sign .ipa") end end def self.description "Codesign an existing ipa file" end def self.example_code [ 'resign( ipa: "path/to/ipa", # can omit if using the `ipa` action signing_identity: "iPhone Distribution: Luka Mirosevic (0123456789)", provisioning_profile: "path/to/profile", # can omit if using the _sigh_ action )', '# You may provide multiple provisioning profiles if the application contains nested # applications or app extensions, which need their own provisioning profile. # You can do so by passing an array of provisioning profile strings or a hash # that associates provisioning profile values to bundle identifier keys. resign( ipa: "path/to/ipa", # can omit if using the `ipa` action signing_identity: "iPhone Distribution: Luka Mirosevic (0123456789)", provisioning_profile: { "com.example.awesome-app" => "path/to/profile", "com.example.awesome-app.app-extension" => "path/to/app-extension/profile" } )' ] end def self.category :code_signing end def self.available_options [ FastlaneCore::ConfigItem.new(key: :ipa, env_name: "FL_RESIGN_IPA", description: "Path to the ipa file to resign. Optional if you use the _gym_ or _xcodebuild_ action", default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH], default_value_dynamic: true, verify_block: proc do |value| UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :signing_identity, env_name: "FL_RESIGN_SIGNING_IDENTITY", description: "Code signing identity to use. e.g. `iPhone Distribution: Luka Mirosevic (0123456789)`"), FastlaneCore::ConfigItem.new(key: :entitlements, env_name: "FL_RESIGN_ENTITLEMENTS", description: "Path to the entitlement file to use, e.g. `myApp/MyApp.entitlements`", conflicting_options: [:use_app_entitlements], optional: true), FastlaneCore::ConfigItem.new(key: :provisioning_profile, env_name: "FL_RESIGN_PROVISIONING_PROFILE", description: "Path to your provisioning_profile. Optional if you use _sigh_", default_value: Actions.lane_context[SharedValues::SIGH_PROFILE_PATH], default_value_dynamic: true, skip_type_validation: true, # allows Hash, Array verify_block: proc do |value| files = case value when Hash then value.values when Enumerable then value else [value] end files.each do |file| UI.user_error!("Couldn't find provisioning profile at path '#{file}'") unless File.exist?(file) end end), FastlaneCore::ConfigItem.new(key: :version, env_name: "FL_RESIGN_VERSION", description: "Version number to force resigned ipa to use. Updates both `CFBundleShortVersionString` and `CFBundleVersion` values in `Info.plist`. Applies for main app and all nested apps or extensions", conflicting_options: [:short_version, :bundle_version], optional: true), FastlaneCore::ConfigItem.new(key: :display_name, env_name: "FL_DISPLAY_NAME", description: "Display name to force resigned ipa to use", optional: true), FastlaneCore::ConfigItem.new(key: :short_version, env_name: "FL_RESIGN_SHORT_VERSION", description: "Short version string to force resigned ipa to use (`CFBundleShortVersionString`)", conflicting_options: [:version], optional: true), FastlaneCore::ConfigItem.new(key: :bundle_version, env_name: "FL_RESIGN_BUNDLE_VERSION", description: "Bundle version to force resigned ipa to use (`CFBundleVersion`)", conflicting_options: [:version], optional: true), FastlaneCore::ConfigItem.new(key: :bundle_id, env_name: "FL_RESIGN_BUNDLE_ID", description: "Set new bundle ID during resign (`CFBundleIdentifier`)", optional: true), FastlaneCore::ConfigItem.new(key: :use_app_entitlements, env_name: "FL_USE_APP_ENTITLEMENTS", description: "Extract app bundle codesigning entitlements and combine with entitlements from new provisioning profile", conflicting_options: [:entitlements], type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :keychain_path, env_name: "FL_RESIGN_KEYCHAIN_PATH", description: "Provide a path to a keychain file that should be used by `/usr/bin/codesign`", optional: true) ] end def self.author "lmirosevic" end def self.is_supported?(platform) platform == :ios end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/scan.rb
fastlane/lib/fastlane/actions/scan.rb
module Fastlane module Actions require 'fastlane/actions/run_tests' class ScanAction < RunTestsAction ##################################################### # @!group Documentation ##################################################### def self.description "Alias for the `run_tests` action" end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/ensure_xcode_version.rb
fastlane/lib/fastlane/actions/ensure_xcode_version.rb
module Fastlane module Actions class EnsureXcodeVersionAction < Action def self.run(params) Actions.verify_gem!('xcode-install') required_version = params[:version] strict = params[:strict] if required_version.to_s.length == 0 # The user didn't provide an Xcode version, let's see # if the current project has a `.xcode-version` file # # The code below can be improved to also consider # the directory of the Xcode project xcode_version_paths = Dir.glob(".xcode-version") if xcode_version_paths.first UI.verbose("Loading required version from #{xcode_version_paths.first}") required_version = File.read(xcode_version_paths.first).strip else UI.user_error!("No version: provided when calling the `ensure_xcode_version` action") end end selected_version = sh("xcversion selected").match(/^Xcode (.*)$/)[1] begin selected_version = Gem::Version.new(selected_version) required_version = Gem::Version.new(required_version) rescue ArgumentError => ex UI.user_error!("Invalid version number provided, make sure it's valid: #{ex}") end if strict == true if selected_version == required_version success(selected_version) else error(selected_version, required_version) end else required_version_numbers = required_version.to_s.split(".") selected_version_numbers = selected_version.to_s.split(".") required_version_numbers.each_with_index do |required_version_number, index| selected_version_number = selected_version_numbers[index] next unless required_version_number != selected_version_number error(selected_version, required_version) break end success(selected_version) end end def self.success(selected_version) UI.success("Selected Xcode version is correct: #{selected_version}") end def self.error(selected_version, required_version) UI.message("Selected Xcode version is not correct: #{selected_version}. You expected #{required_version}.") UI.message("To correct this, use: `xcode_select(version: #{required_version})`.") UI.user_error!("Selected Xcode version doesn't match your requirement.\nExpected: Xcode #{required_version}\nActual: Xcode #{selected_version}\n") end ##################################################### # @!group Documentation ##################################################### def self.description "Ensure the right version of Xcode is used" end def self.details [ "If building your app requires a specific version of Xcode, you can invoke this command before using gym.", "For example, to ensure that a beta version of Xcode is not accidentally selected to build, which would make uploading to TestFlight fail.", "You can either manually provide a specific version using `version:` or you make use of the `.xcode-version` file.", "Using the `strict` parameter, you can either verify the full set of version numbers strictly (i.e. `11.3.1`) or only a subset of them (i.e. `11.3` or `11`)." ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :version, env_name: "FL_ENSURE_XCODE_VERSION", description: "Xcode version to verify that is selected", optional: true), FastlaneCore::ConfigItem.new(key: :strict, description: "Should the version be verified strictly (all 3 version numbers), or matching only the given version numbers (i.e. `11.3` == `11.3.x`)", type: Boolean, default_value: true) ] end def self.output [ ['FL_ENSURE_XCODE_VERSION', 'Xcode version to verify that is selected'] ] end def self.return_value end def self.authors ["JaviSoto", "KrauseFx"] end def self.example_code [ 'ensure_xcode_version(version: "12.5")' ] end def self.category :building end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.deprecated_notes "The xcode-install gem, which this action depends on, has been sunset. Please migrate to [xcodes](https://docs.fastlane.tools/actions/xcodes). You can find a migration guide here: [xcpretty/xcode-install/MIGRATION.md](https://github.com/xcpretty/xcode-install/blob/master/MIGRATION.md)" end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/deliver.rb
fastlane/lib/fastlane/actions/deliver.rb
module Fastlane module Actions require 'fastlane/actions/upload_to_app_store' class DeliverAction < UploadToAppStoreAction ##################################################### # @!group Documentation ##################################################### def self.description "Alias for the `upload_to_app_store` action" end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/install_on_device.rb
fastlane/lib/fastlane/actions/install_on_device.rb
module Fastlane module Actions module SharedValues end class InstallOnDeviceAction < Action def self.run(params) unless Helper.test? UI.user_error!("ios-deploy not installed, see https://github.com/ios-control/ios-deploy for instructions") if `which ios-deploy`.length == 0 end taxi_cmd = [ "ios-deploy", params[:extra], "--bundle", params[:ipa].shellescape ] taxi_cmd << "--no-wifi" if params[:skip_wifi] taxi_cmd << ["--id", params[:device_id]] if params[:device_id] taxi_cmd.compact! return taxi_cmd.join(" ") if Helper.test? Actions.sh(taxi_cmd.join(" ")) UI.message("Deployed #{params[:ipa]} to device!") end ##################################################### # @!group Documentation ##################################################### def self.description "Installs an .ipa file on a connected iOS-device via usb or wifi" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :extra, short_option: "-X", env_name: "FL_IOD_EXTRA", description: "Extra Command-line arguments passed to ios-deploy", optional: true), FastlaneCore::ConfigItem.new(key: :device_id, short_option: "-d", env_name: "FL_IOD_DEVICE_ID", description: "id of the device / if not set defaults to first found device", optional: true), FastlaneCore::ConfigItem.new(key: :skip_wifi, short_option: "-w", env_name: "FL_IOD_WIFI", description: "Do not search for devices via WiFi", optional: true, type: Boolean), FastlaneCore::ConfigItem.new(key: :ipa, short_option: "-i", env_name: "FL_IOD_IPA", description: "The IPA file to put on the device", optional: true, default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] || Dir["*.ipa"].first, default_value_dynamic: true, verify_block: proc do |value| unless Helper.test? UI.user_error!("Could not find ipa file at path '#{value}'") unless File.exist?(value) UI.user_error!("'#{value}' doesn't seem to be an ipa file") unless value.end_with?(".ipa") end end) ] end def self.authors ["hjanuschka"] end def self.details "Installs the ipa on the device. If no id is given, the first found iOS device will be used. Works via USB or Wi-Fi. This requires `ios-deploy` to be installed. Please have a look at [ios-deploy](https://github.com/ios-control/ios-deploy). To quickly install it, use `brew install ios-deploy`" end def self.is_supported?(platform) platform == :ios end def self.example_code [ 'install_on_device( device_id: "a3be6c9ff7e5c3c6028597513243b0f933b876d4", ipa: "./app.ipa" )' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/github_api.rb
fastlane/lib/fastlane/actions/github_api.rb
module Fastlane module Actions module SharedValues GITHUB_API_STATUS_CODE = :GITHUB_API_STATUS_CODE GITHUB_API_RESPONSE = :GITHUB_API_RESPONSE GITHUB_API_JSON = :GITHUB_API_JSON end class GithubApiAction < Action class << self def run(params) require 'json' http_method = (params[:http_method] || 'GET').to_s.upcase url = construct_url(params[:server_url], params[:path], params[:url]) headers = construct_headers(params[:api_token], params[:api_bearer], params[:headers]) payload = construct_body(params[:body], params[:raw_body]) error_handlers = params[:error_handlers] || {} secure = params[:secure] response = call_endpoint( url, http_method, headers, payload, secure ) status_code = response[:status] result = { status: status_code, body: response.body || "", json: parse_json(response.body) || {} } if status_code.between?(200, 299) UI.verbose("Response:") UI.verbose(response.body) UI.verbose("---") yield(result) if block_given? else handled_error = error_handlers[status_code] || error_handlers['*'] if handled_error handled_error.call(result) else UI.error("---") UI.error("Request failed:\n#{http_method}: #{url}") UI.error("Headers:\n#{headers}") UI.error("---") UI.error("Response:") UI.error(response.body) UI.user_error!("GitHub responded with #{status_code}\n---\n#{response.body}") end end Actions.lane_context[SharedValues::GITHUB_API_STATUS_CODE] = result[:status] Actions.lane_context[SharedValues::GITHUB_API_RESPONSE] = result[:body] Actions.lane_context[SharedValues::GITHUB_API_JSON] = result[:json] return result end ##################################################### # @!group Documentation ##################################################### def description "Call a GitHub API endpoint and get the resulting JSON response" end def details [ "Calls any GitHub API endpoint. You must provide your GitHub Personal token (get one from [https://github.com/settings/tokens/new](https://github.com/settings/tokens/new)).", "Out parameters provide the status code and the full response JSON if valid, otherwise the raw response body.", "Documentation: [https://developer.github.com/v3](https://developer.github.com/v3)." ].join("\n") end def available_options [ FastlaneCore::ConfigItem.new(key: :server_url, env_name: "FL_GITHUB_API_SERVER_URL", description: "The server url. e.g. 'https://your.internal.github.host/api/v3' (Default: 'https://api.github.com')", default_value: "https://api.github.com", optional: true, verify_block: proc do |value| UI.user_error!("Please include the protocol in the server url, e.g. https://your.github.server/api/v3") unless value.include?("//") end), FastlaneCore::ConfigItem.new(key: :api_token, env_name: "FL_GITHUB_API_TOKEN", description: "Personal API Token for GitHub - generate one at https://github.com/settings/tokens", conflicting_options: [:api_bearer], sensitive: true, code_gen_sensitive: true, default_value: ENV["GITHUB_API_TOKEN"], default_value_dynamic: true, optional: true), FastlaneCore::ConfigItem.new(key: :api_bearer, env_name: "FL_GITHUB_API_BEARER", sensitive: true, code_gen_sensitive: true, description: "Use a Bearer authorization token. Usually generated by GitHub Apps, e.g. GitHub Actions GITHUB_TOKEN environment variable", conflicting_options: [:api_token], optional: true, default_value: nil), FastlaneCore::ConfigItem.new(key: :http_method, env_name: "FL_GITHUB_API_HTTP_METHOD", description: "The HTTP method. e.g. GET / POST", default_value: "GET", optional: true, verify_block: proc do |value| unless %w(GET POST PUT DELETE HEAD CONNECT PATCH).include?(value.to_s.upcase) UI.user_error!("Unrecognised HTTP method") end end), FastlaneCore::ConfigItem.new(key: :body, env_name: "FL_GITHUB_API_REQUEST_BODY", description: "The request body in JSON or hash format", skip_type_validation: true, # allow Hash, Array default_value: {}, optional: true), FastlaneCore::ConfigItem.new(key: :raw_body, env_name: "FL_GITHUB_API_REQUEST_RAW_BODY", description: "The request body taken verbatim instead of as JSON, useful for file uploads", optional: true), FastlaneCore::ConfigItem.new(key: :path, env_name: "FL_GITHUB_API_PATH", description: "The endpoint path. e.g. '/repos/:owner/:repo/readme'", optional: true), FastlaneCore::ConfigItem.new(key: :url, env_name: "FL_GITHUB_API_URL", description: "The complete full url - used instead of path. e.g. 'https://uploads.github.com/repos/fastlane...'", optional: true, verify_block: proc do |value| UI.user_error!("Please include the protocol in the url, e.g. https://uploads.github.com") unless value.include?("//") end), FastlaneCore::ConfigItem.new(key: :error_handlers, description: "Optional error handling hash based on status code, or pass '*' to handle all errors", type: Hash, default_value: {}, optional: true), FastlaneCore::ConfigItem.new(key: :headers, env_name: "FL_GITHUB_API_HEADERS", description: "Optional headers to apply", type: Hash, default_value: {}, optional: true), FastlaneCore::ConfigItem.new(key: :secure, env_name: "FL_GITHUB_API_SECURE", description: "Optionally disable secure requests (ssl_verify_peer)", type: Boolean, default_value: true, optional: true) ] end def output [ ['GITHUB_API_STATUS_CODE', 'The status code returned from the request'], ['GITHUB_API_RESPONSE', 'The full response body'], ['GITHUB_API_JSON', 'The parsed json returned from GitHub'] ] end def return_value "A hash including the HTTP status code (:status), the response body (:body), and if valid JSON has been returned the parsed JSON (:json)." end def authors ["tommeier"] end def example_code [ 'result = github_api( server_url: "https://api.github.com", api_token: ENV["GITHUB_TOKEN"], http_method: "GET", path: "/repos/:owner/:repo/readme", body: { ref: "master" } )', '# Alternatively call directly with optional error handling or block usage GithubApiAction.run( server_url: "https://api.github.com", api_token: ENV["GITHUB_TOKEN"], http_method: "GET", path: "/repos/:owner/:repo/readme", error_handlers: { 404 => proc do |result| UI.message("Something went wrong - I couldn\'t find it...") end, \'*\' => proc do |result| UI.message("Handle all error codes other than 404") end } ) do |result| UI.message("JSON returned: #{result[:json]}") end ' ] end def is_supported?(platform) true end def category :source_control end private def construct_headers(api_token, api_bearer, overrides) require 'base64' headers = { 'User-Agent' => 'fastlane-github_api' } headers['Authorization'] = "Basic #{Base64.strict_encode64(api_token)}" if api_token headers['Authorization'] = "Bearer #{api_bearer}" if api_bearer headers.merge(overrides || {}) end def construct_url(server_url, path, url) return_url = (server_url && path) ? File.join(server_url, path) : url UI.user_error!("Please provide either `server_url` (e.g. https://api.github.com) and 'path' or full 'url' for GitHub API endpoint") unless return_url return_url end def construct_body(body, raw_body) body ||= {} if raw_body raw_body elsif body.kind_of?(Hash) body.to_json elsif body.kind_of?(Array) body.to_json else UI.user_error!("Please provide valid JSON, or a hash as request body") unless parse_json(body) body end end def parse_json(value) JSON.parse(value) rescue JSON::ParserError nil end def call_endpoint(url, http_method, headers, body, secure) require 'excon' Excon.defaults[:ssl_verify_peer] = secure middlewares = Excon.defaults[:middlewares] + [Excon::Middleware::RedirectFollower] # allow redirect in case of repo renames UI.verbose("#{http_method} : #{url}") connection = Excon.new(url) connection.request( method: http_method, headers: headers, middlewares: middlewares, body: body, debug_request: FastlaneCore::Globals.verbose?, debug_response: FastlaneCore::Globals.verbose? ) end end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/sourcedocs.rb
fastlane/lib/fastlane/actions/sourcedocs.rb
module Fastlane module Actions class SourcedocsAction < Action def self.run(params) UI.user_error!("You have to install sourcedocs using `brew install sourcedocs`") if `which sourcedocs`.to_s.length == 0 && !Helper.test? command = "sourcedocs generate" command << " --all-modules" if params[:all_modules] command << " --spm-module #{params[:spm_module]}" unless params[:spm_module].nil? command << " --module-name #{params[:module_name]}" unless params[:module_name].nil? command << " --link-beginning #{params[:link_beginning]}" unless params[:link_beginning].nil? command << " --link-ending #{params[:link_ending]}" unless params[:link_ending].nil? command << " --output-folder #{params[:output_folder]}" unless params[:output_folder].nil? command << " --min-acl #{params[:min_acl]}" unless params[:min_acl].nil? command << " --module-name-path" if params[:module_name_path] command << " --clean" if params[:clean] command << " --collapsible" if params[:collapsible] command << " --table-of-contents" if params[:table_of_contents] command << " --reproducible-docs" if params[:reproducible] unless params[:scheme].nil? command << " -- -scheme #{params[:scheme]}" command << " -sdk #{params[:sdk_platform]}" unless params[:sdk_platform].nil? end Actions.sh(command) end ##################################################### # @!group Documentation ##################################################### def self.description "Generate docs using SourceDocs" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :all_modules, env_name: 'FL_SOURCEDOCS_OUTPUT_ALL_MODULES', description: 'Generate documentation for all modules in a Swift package', type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :spm_module, env_name: 'FL_SOURCEDOCS_SPM_MODULE', description: 'Generate documentation for Swift Package Manager module', optional: true), FastlaneCore::ConfigItem.new(key: :module_name, env_name: 'FL_SOURCEDOCS_MODULE_NAME', description: 'Generate documentation for a Swift module', optional: true), FastlaneCore::ConfigItem.new(key: :link_beginning, env_name: 'FL_SOURCEDOCS_LINK_BEGINNING', description: 'The text to begin links with', optional: true), FastlaneCore::ConfigItem.new(key: :link_ending, env_name: 'FL_SOURCEDOCS_LINK_ENDING', description: 'The text to end links with (default: .md)', optional: true), FastlaneCore::ConfigItem.new(key: :output_folder, env_name: 'FL_SOURCEDOCS_OUTPUT_FOLDER', description: 'Output directory to clean (default: Documentation/Reference)', optional: false), FastlaneCore::ConfigItem.new(key: :min_acl, env_name: 'FL_SOURCEDOCS_MIN_ACL', description: 'Access level to include in documentation [private, fileprivate, internal, public, open] (default: public)', optional: true), FastlaneCore::ConfigItem.new(key: :module_name_path, env_name: 'FL_SOURCEDOCS_MODULE_NAME_PATH', description: 'Include the module name as part of the output folder path', type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :clean, env_name: 'FL_SOURCEDOCS_CLEAN', description: 'Delete output folder before generating documentation', type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :collapsible, env_name: 'FL_SOURCEDOCS_COLLAPSIBLE', description: 'Put methods, properties and enum cases inside collapsible blocks', type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :table_of_contents, env_name: 'FL_SOURCEDOCS_TABLE_OF_CONTENT', description: 'Generate a table of contents with properties and methods for each type', type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :reproducible, env_name: 'FL_SOURCEDOCS_REPRODUCIBLE', description: 'Generate documentation that is reproducible: only depends on the sources', type: Boolean, optional: true), FastlaneCore::ConfigItem.new(key: :scheme, env_name: 'FL_SOURCEDOCS_SCHEME', description: 'Create documentation for specific scheme', optional: true), FastlaneCore::ConfigItem.new(key: :sdk_platform, env_name: 'FL_SOURCEDOCS_SDK_PlATFORM', description: 'Create documentation for specific sdk platform', optional: true) ] end def self.output end def self.return_value end def self.authors ["Kukurijek"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ "sourcedocs(output_folder: 'docs')", "sourcedocs(output_folder: 'docs', clean: true, reproducible: true, scheme: 'MyApp')" ] end def self.category :documentation end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/clean_build_artifacts.rb
fastlane/lib/fastlane/actions/clean_build_artifacts.rb
module Fastlane module Actions class CleanBuildArtifactsAction < Action def self.run(options) paths = [ Actions.lane_context[Actions::SharedValues::IPA_OUTPUT_PATH], Actions.lane_context[Actions::SharedValues::DSYM_OUTPUT_PATH], Actions.lane_context[Actions::SharedValues::CERT_FILE_PATH] ] paths += Actions.lane_context[Actions::SharedValues::SIGH_PROFILE_PATHS] || [] paths += Actions.lane_context[Actions::SharedValues::DSYM_PATHS] || [] paths = paths.uniq paths.reject { |file| file.nil? || !File.exist?(file) }.each do |file| if options[:exclude_pattern] next if file.match(options[:exclude_pattern]) end UI.verbose("Cleaning up '#{file}'") File.delete(file) end Actions.lane_context[Actions::SharedValues::SIGH_PROFILE_PATHS] = nil Actions.lane_context[Actions::SharedValues::DSYM_PATHS] = nil Actions.lane_context[Actions::SharedValues::DSYM_LATEST_UPLOADED_DATE] = nil UI.success('Cleaned up build artifacts 🐙') end def self.available_options [ FastlaneCore::ConfigItem.new(key: :exclude_pattern, env_name: "FL_CLEAN_BUILD_ARTIFACTS_EXCLUDE_PATTERN", description: "Exclude all files from clearing that match the given Regex pattern: e.g. '.*\.mobileprovision'", optional: true) ] end def self.description "Deletes files created as result of running gym, cert, sigh or download_dsyms" end def self.details [ "This action deletes the files that get created in your repo as a result of running the _gym_ and _sigh_ commands. It doesn't delete the `fastlane/report.xml` though, this is probably more suited for the .gitignore.", "", "Useful if you quickly want to send out a test build by dropping down to the command line and typing something like `fastlane beta`, without leaving your repo in a messy state afterwards." ].join("\n") end def self.author "lmirosevic" end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'clean_build_artifacts' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb
fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb
module Fastlane module Actions class UploadSymbolsToCrashlyticsAction < Action def self.run(params) require 'tmpdir' find_binary_path(params) unless params[:app_id] find_gsp_path(params) find_api_token(params) end if !params[:app_id] && !params[:gsp_path] && !params[:api_token] UI.user_error!('Either Firebase Crashlytics App ID, path to GoogleService-Info.plist or legacy Fabric API key must be given.') end dsym_paths = [] dsym_paths << params[:dsym_path] if params[:dsym_path] dsym_paths += Actions.lane_context[SharedValues::DSYM_PATHS] if Actions.lane_context[SharedValues::DSYM_PATHS] # Allows adding of additional multiple dsym_paths since :dsym_path can be autoset by other actions dsym_paths += params[:dsym_paths] if params[:dsym_paths] if dsym_paths.count == 0 UI.error("Couldn't find any dSYMs, please pass them using the dsym_path option") return nil end # Get rid of duplicates (which might occur when both passed and detected) dsym_paths = dsym_paths.collect { |a| File.expand_path(a) } dsym_paths.uniq! max_worker_threads = params[:dsym_worker_threads] if max_worker_threads > 1 UI.message("Using #{max_worker_threads} threads for Crashlytics dSYM upload 🏎") end worker = FastlaneCore::QueueWorker.new(max_worker_threads) do |dsym_path| handle_dsym(params, dsym_path, max_worker_threads) end worker.batch_enqueue(dsym_paths) worker.start UI.success("Successfully uploaded dSYM files to Crashlytics 💯") end # @param current_path this is a path to either a dSYM or a zipped dSYM # this might also be either nested or not, we're flexible def self.handle_dsym(params, current_path, max_worker_threads) if current_path.end_with?(".dSYM", ".zip") upload_dsym(params, current_path) else UI.error("Don't know how to handle '#{current_path}'") end end def self.upload_dsym(params, path) UI.message("Uploading '#{path}'...") command = [] command << File.expand_path(params[:binary_path]).shellescape if params[:debug] command << "-d" end if params[:app_id] command << "-ai #{params[:app_id].shellescape}" elsif params[:gsp_path] command << "-gsp #{params[:gsp_path].shellescape}" elsif params[:api_token] command << "-a #{params[:api_token]}" end command << "-p #{params[:platform] == 'appletvos' ? 'tvos' : params[:platform]}" command << File.expand_path(path).shellescape begin command_to_execute = command.join(" ") UI.verbose("upload_dsym using command: #{command_to_execute}") Actions.sh(command_to_execute, log: params[:debug]) rescue => ex UI.error(ex.to_s) # it fails, however we don't want to fail everything just for this end end def self.find_api_token(params) return if params[:gsp_path] unless params[:api_token].to_s.length > 0 Dir["./**/Info.plist"].each do |current| result = Actions::GetInfoPlistValueAction.run(path: current, key: "Fabric") next unless result next unless result.kind_of?(Hash) params[:api_token] ||= result["APIKey"] UI.verbose("found an APIKey in #{current}") end end end def self.find_gsp_path(params) return if params[:api_token] && params[:gsp_path].nil? if params[:gsp_path].to_s.length > 0 params[:gsp_path] = File.expand_path(params[:gsp_path]) else gsp_path = Dir["./**/GoogleService-Info.plist"].first params[:gsp_path] = File.expand_path(gsp_path) unless gsp_path.nil? end end def self.find_binary_path(params) params[:binary_path] ||= (Dir["/Applications/Fabric.app/**/upload-symbols"] + Dir["./Pods/Fabric/upload-symbols"] + Dir["./scripts/upload-symbols"] + Dir["./Pods/FirebaseCrashlytics/upload-symbols"]).last UI.user_error!("Failed to find Fabric's upload_symbols binary at /Applications/Fabric.app/**/upload-symbols or ./Pods/**/upload-symbols. Please specify the location of the binary explicitly by using the binary_path option") unless params[:binary_path] params[:binary_path] = File.expand_path(params[:binary_path]) end ##################################################### # @!group Documentation ##################################################### def self.description "Upload dSYM symbolication files to Crashlytics" end def self.details "This action allows you to upload symbolication files to Crashlytics. It's extra useful if you use it to download the latest dSYM files from Apple when you use Bitcode. This action will not fail the build if one of the uploads failed. The reason for that is that sometimes some of dSYM files are invalid, and we don't want them to fail the complete build." end def self.available_options [ FastlaneCore::ConfigItem.new(key: :dsym_path, env_name: "FL_UPLOAD_SYMBOLS_TO_CRASHLYTICS_DSYM_PATH", description: "Path to the DSYM file or zip to upload", default_value: ENV[SharedValues::DSYM_OUTPUT_PATH.to_s] || (Dir["./**/*.dSYM"] + Dir["./**/*.dSYM.zip"]).sort_by { |f| File.mtime(f) }.last, default_value_dynamic: true, optional: true, verify_block: proc do |value| UI.user_error!("Couldn't find file at path '#{File.expand_path(value)}'") unless File.exist?(value) UI.user_error!("Symbolication file needs to be dSYM or zip") unless value.end_with?(".zip", ".dSYM") end), FastlaneCore::ConfigItem.new(key: :dsym_paths, env_name: "FL_UPLOAD_SYMBOLS_TO_CRASHLYTICS_DSYM_PATHS", description: "Paths to the DSYM files or zips to upload", optional: true, type: Array, verify_block: proc do |values| values.each do |value| UI.user_error!("Couldn't find file at path '#{File.expand_path(value)}'") unless File.exist?(value) UI.user_error!("Symbolication file needs to be dSYM or zip") unless value.end_with?(".zip", ".dSYM") end end), FastlaneCore::ConfigItem.new(key: :api_token, env_name: "CRASHLYTICS_API_TOKEN", sensitive: true, optional: true, description: "Crashlytics API Key", verify_block: proc do |value| UI.user_error!("No API token for Crashlytics given, pass using `api_token: 'token'`") if value.to_s.length == 0 end), FastlaneCore::ConfigItem.new(key: :gsp_path, env_name: "GOOGLE_SERVICES_INFO_PLIST_PATH", code_gen_sensitive: true, optional: true, description: "Path to GoogleService-Info.plist", verify_block: proc do |value| UI.user_error!("Couldn't find file at path '#{File.expand_path(value)}'") unless File.exist?(value) UI.user_error!("No Path to GoogleService-Info.plist for Firebase Crashlytics given, pass using `gsp_path: 'path'`") if value.to_s.length == 0 end), FastlaneCore::ConfigItem.new(key: :app_id, env_name: "CRASHLYTICS_APP_ID", sensitive: true, optional: true, description: "Firebase Crashlytics APP ID", verify_block: proc do |value| UI.user_error!("No App ID for Firebase Crashlytics given, pass using `app_id: 'appId'`") if value.to_s.length == 0 end), FastlaneCore::ConfigItem.new(key: :binary_path, env_name: "FL_UPLOAD_SYMBOLS_TO_CRASHLYTICS_BINARY_PATH", description: "The path to the upload-symbols file of the Fabric app", optional: true, verify_block: proc do |value| value = File.expand_path(value) UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :platform, env_name: "FL_UPLOAD_SYMBOLS_TO_CRASHLYTICS_PLATFORM", description: "The platform of the app (ios, appletvos, mac)", default_value: "ios", verify_block: proc do |value| available = ['ios', 'appletvos', 'mac'] UI.user_error!("Invalid platform '#{value}', must be #{available.join(', ')}") unless available.include?(value) end), FastlaneCore::ConfigItem.new(key: :dsym_worker_threads, env_name: "FL_UPLOAD_SYMBOLS_TO_CRASHLYTICS_DSYM_WORKER_THREADS", type: Integer, default_value: 1, optional: true, description: "The number of threads to use for simultaneous dSYM upload", verify_block: proc do |value| min_threads = 1 UI.user_error!("Too few threads (#{value}) minimum number of threads: #{min_threads}") unless value >= min_threads end), FastlaneCore::ConfigItem.new(key: :debug, env_name: "FL_UPLOAD_SYMBOLS_TO_CRASHLYTICS_DEBUG", description: "Enable debug mode for upload-symbols", type: Boolean, default_value: false) ] end def self.output nil end def self.return_value nil end def self.authors ["KrauseFx"] end def self.is_supported?(platform) [:ios, :appletvos].include?(platform) end def self.example_code [ 'upload_symbols_to_crashlytics(dsym_path: "./App.dSYM.zip")' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/ifttt.rb
fastlane/lib/fastlane/actions/ifttt.rb
module Fastlane module Actions class IftttAction < Action def self.run(options) require "net/http" require "uri" uri = URI.parse("https://maker.ifttt.com/trigger/#{options[:event_name]}/with/key/#{options[:api_key]}") https = Net::HTTP.new(uri.host, uri.port) https.use_ssl = true req = Net::HTTP::Post.new(uri.request_uri) req.set_form_data({ "value1" => options[:value1], "value2" => options[:value2], "value3" => options[:value3] }) response = https.request(req) UI.user_error!("Failed to make a request to IFTTT. #{response.message}.") unless response.code == "200" UI.success("Successfully made a request to IFTTT.") end ##################################################### # @!group Documentation ##################################################### def self.description "Connect to the [IFTTT Maker Channel](https://ifttt.com/maker)" end def self.details "Connect to the IFTTT [Maker Channel](https://ifttt.com/maker). An IFTTT Recipe has two components: a Trigger and an Action. In this case, the Trigger will fire every time the Maker Channel receives a web request (made by this _fastlane_ action) to notify it of an event. The Action can be anything that IFTTT supports: email, SMS, etc." end def self.available_options [ FastlaneCore::ConfigItem.new(key: :api_key, env_name: "IFTTT_API_KEY", sensitive: true, description: "API key", verify_block: proc do |value| raise UI.error("No API key given, pass using `api_key: 'key'`") if value.to_s.empty? end), FastlaneCore::ConfigItem.new(key: :event_name, env_name: "IFTTT_EVENT_NAME", description: "The name of the event that will be triggered", verify_block: proc do |value| raise UI.error("No event name given, pass using `event_name: 'name'`") if value.to_s.empty? end), FastlaneCore::ConfigItem.new(key: :value1, env_name: "IFTTT_VALUE1", description: "Extra data sent with the event", optional: true), FastlaneCore::ConfigItem.new(key: :value2, env_name: "IFTTT_VALUE2", description: "Extra data sent with the event", optional: true), FastlaneCore::ConfigItem.new(key: :value3, env_name: "IFTTT_VALUE3", description: "Extra data sent with the event", optional: true) ] end def self.is_supported?(platform) true end def self.authors ["vpolouchkine"] end def self.example_code [ 'ifttt( api_key: "...", event_name: "...", value1: "foo", value2: "bar", value3: "baz" )' ] end def self.category :notifications end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/hockey.rb
fastlane/lib/fastlane/actions/hockey.rb
module Fastlane module Actions module SharedValues HOCKEY_DOWNLOAD_LINK = :HOCKEY_DOWNLOAD_LINK HOCKEY_BUILD_INFORMATION = :HOCKEY_BUILD_INFORMATION # contains all keys/values from the HockeyApp API, like :title, :bundle_identifier end # rubocop:disable Metrics/ClassLength class HockeyAction < Action def self.connection(options) require 'faraday' require 'faraday_middleware' base_url = options.delete(:bypass_cdn) ? "https://rink.hockeyapp.net" : "https://upload.hockeyapp.net" foptions = { url: base_url } Faraday.new(foptions) do |builder| builder.request(:multipart) builder.request(:url_encoded) builder.response(:json, content_type: /\bjson$/) builder.use(FaradayMiddleware::FollowRedirects) builder.adapter(:net_http) end end def self.upload(api_token, ipa, options) create_update = options.delete(:create_update) if create_update self.create_and_update_build(api_token, ipa, options) else self.upload_build(api_token, ipa, options) end end # Uses https://support.hockeyapp.net/kb/api/api-versions#upload-version if a `public_identifier` was specified # otherwise https://support.hockeyapp.net/kb/api/api-apps#upload-app def self.upload_build(api_token, ipa, options) connection = self.connection(options) options[:ipa] = Faraday::UploadIO.new(ipa, 'application/octet-stream') if ipa && File.exist?(ipa) dsym_filename = options.delete(:dsym_filename) if dsym_filename options[:dsym] = Faraday::UploadIO.new(dsym_filename, 'application/octet-stream') end connection.post do |req| req.options.timeout = options.delete(:timeout) if options[:public_identifier].nil? req.url("/api/2/apps/upload") else req.url("/api/2/apps/#{options.delete(:public_identifier)}/app_versions/upload") end req.headers['X-HockeyAppToken'] = api_token req.body = options end end # Uses https://support.hockeyapp.net/kb/api/api-versions#create-version # and https://support.hockeyapp.net/kb/api/api-versions#update-version # to upload a build def self.create_and_update_build(api_token, ipa, options) [:public_identifier, :bundle_short_version, :bundle_version].each do |key| UI.user_error!("To use the 'create_update' upload mechanism you need to pass the '#{key.to_sym}' option.") unless options[key] end # https://support.hockeyapp.net/discussions/problems/33355-is-uploadhockeyappnet-available-for-general-use # GET requests are cached on CDN, so bypass it options[:bypass_cdn] = true connection = self.connection(options) options.delete(:ipa) options.delete(:apk) app_id = options.delete(:public_identifier) ipaio = Faraday::UploadIO.new(ipa, 'application/octet-stream') if ipa && File.exist?(ipa) dsym = options.delete(:dsym) if dsym dsym_io = Faraday::UploadIO.new(dsym, 'application/octet-stream') if dsym && File.exist?(dsym) end # https://support.hockeyapp.net/discussions/problems/83559 # Should not set status to "2" (downloadable) until after the app is uploaded, so allow the caller # to specify a different status for the `create` step update_status = options[:status] options[:status] = options[:create_status] response = connection.get do |req| req.url("/api/2/apps/#{app_id}/app_versions/new") req.headers['X-HockeyAppToken'] = api_token req.body = options end case response.status when 200...300 app_version_id = response.body['id'] UI.message("successfully created version with id #{app_version_id}") else UI.user_error!("Error trying to create app version: #{response.status} - #{response.body}") end options[:ipa] = ipaio if dsym options[:dsym] = dsym_io end options[:status] = update_status connection.put do |req| req.options.timeout = options.delete(:timeout) req.url("/api/2/apps/#{app_id}/app_versions/#{app_version_id}") req.headers['X-HockeyAppToken'] = api_token req.body = options end end def self.run(options) build_file = [ options[:ipa], options[:apk] ].detect { |e| !e.to_s.empty? } if options[:dsym] dsym_filename = options[:dsym] else if build_file.nil? UI.user_error!("You have to provide a build file (params 'apk' or 'ipa')") end if options[:ipa].to_s.end_with?(".ipa") dsym_path = options[:ipa].to_s.gsub('.ipa', '.app.dSYM.zip') if File.exist?(dsym_path) dsym_filename = dsym_path else UI.important("Symbols not found on path #{File.expand_path(dsym_path)}. Crashes won't be symbolicated properly") dsym_filename = nil end end end UI.user_error!("Symbols on path '#{File.expand_path(dsym_filename)}' not found") if dsym_filename && !File.exist?(dsym_filename) if options[:upload_dsym_only] UI.success('Starting with dSYM upload to HockeyApp... this could take some time.') else UI.success('Starting with file(s) upload to HockeyApp... this could take some time.') end values = options.values values[:dsym_filename] = dsym_filename values[:notes_type] = options[:notes_type] api_token = values.delete(:api_token) values.delete_if { |k, v| v.nil? } return values if Helper.test? ipa_filename = build_file ipa_filename = nil if options[:upload_dsym_only] response = self.upload(api_token, ipa_filename, values) case response.status when 200...300 url = response.body['public_url'] Actions.lane_context[SharedValues::HOCKEY_DOWNLOAD_LINK] = url Actions.lane_context[SharedValues::HOCKEY_BUILD_INFORMATION] = response.body UI.message("Public Download URL: #{url}") if url UI.success('Build successfully uploaded to HockeyApp!') else if response.body.to_s.include?("App could not be created") UI.user_error!("Hockey has an issue processing this app. Please confirm that an app in Hockey matches this IPA's bundle ID or that you are using the correct API upload token. If error persists, please provide the :public_identifier option from the HockeyApp website. More information https://github.com/fastlane/fastlane/issues/400") else UI.user_error!("Error when trying to upload file(s) to HockeyApp: #{response.status} - #{response.body}") end end end def self.description "Refer to [App Center](https://github.com/Microsoft/fastlane-plugin-appcenter/)" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :apk, env_name: "FL_HOCKEY_APK", description: "Path to your APK file", default_value: Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], default_value_dynamic: true, optional: true, verify_block: proc do |value| UI.user_error!("Couldn't find apk file at path '#{value}'") unless File.exist?(value) end, conflicting_options: [:ipa], conflict_block: proc do |value| UI.user_error!("You can't use 'apk' and '#{value.key}' options in one run") end), FastlaneCore::ConfigItem.new(key: :api_token, env_name: "FL_HOCKEY_API_TOKEN", sensitive: true, description: "API Token for Hockey Access", verify_block: proc do |value| UI.user_error!("No API token for Hockey given, pass using `api_token: 'token'`") unless value && !value.empty? end), FastlaneCore::ConfigItem.new(key: :ipa, env_name: "FL_HOCKEY_IPA", description: "Path to your IPA file. Optional if you use the _gym_ or _xcodebuild_ action. For Mac zip the .app. For Android provide path to .apk file. In addition you could use this to upload .msi, .zip, .pkg, etc if you use the 'create_update' mechanism", default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH], default_value_dynamic: true, optional: true, verify_block: proc do |value| UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value) end, conflicting_options: [:apk], conflict_block: proc do |value| UI.user_error!("You can't use 'ipa' and '#{value.key}' options in one run") end), FastlaneCore::ConfigItem.new(key: :dsym, env_name: "FL_HOCKEY_DSYM", description: "Path to your symbols file. For iOS and Mac provide path to app.dSYM.zip. For Android provide path to mappings.txt file", default_value: Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH], default_value_dynamic: true, optional: true), FastlaneCore::ConfigItem.new(key: :create_update, env_name: "FL_HOCKEY_CREATE_UPDATE", description: "Set true if you want to create then update your app as opposed to just upload it."\ " You will need the 'public_identifier', 'bundle_version' and 'bundle_short_version'", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :notes, env_name: "FL_HOCKEY_NOTES", description: "Beta Notes", default_value: Actions.lane_context[SharedValues::FL_CHANGELOG] || "No changelog given", default_value_dynamic: true), FastlaneCore::ConfigItem.new(key: :notify, env_name: "FL_HOCKEY_NOTIFY", description: "Notify testers? \"1\" for yes", default_value: "1"), FastlaneCore::ConfigItem.new(key: :status, env_name: "FL_HOCKEY_STATUS", description: "Download status: \"1\" = No user can download; \"2\" = Available for download (only possible with full-access token)", default_value: "2"), FastlaneCore::ConfigItem.new(key: :create_status, env_name: "FL_HOCKEY_CREATE_STATUS", description: "Download status for initial version creation when create_update is true: \"1\" = No user can download; \"2\" = Available for download (only possible with full-access token)", default_value: "2"), FastlaneCore::ConfigItem.new(key: :notes_type, env_name: "FL_HOCKEY_NOTES_TYPE", description: "Notes type for your :notes, \"0\" = Textile, \"1\" = Markdown (default)", default_value: "1"), FastlaneCore::ConfigItem.new(key: :release_type, env_name: "FL_HOCKEY_RELEASE_TYPE", description: "Release type of the app: \"0\" = Beta (default), \"1\" = Store, \"2\" = Alpha, \"3\" = Enterprise", default_value: "0"), FastlaneCore::ConfigItem.new(key: :mandatory, env_name: "FL_HOCKEY_MANDATORY", description: "Set to \"1\" to make this update mandatory", default_value: "0"), FastlaneCore::ConfigItem.new(key: :teams, env_name: "FL_HOCKEY_TEAMS", description: "Comma separated list of team ID numbers to which this build will be restricted", optional: true), FastlaneCore::ConfigItem.new(key: :users, env_name: "FL_HOCKEY_USERS", description: "Comma separated list of user ID numbers to which this build will be restricted", optional: true), FastlaneCore::ConfigItem.new(key: :tags, env_name: "FL_HOCKEY_TAGS", description: "Comma separated list of tags which will receive access to the build", optional: true), FastlaneCore::ConfigItem.new(key: :bundle_short_version, env_name: "FL_HOCKEY_BUNDLE_SHORT_VERSION", description: "The bundle_short_version of your application, required when using `create_update`", optional: true), FastlaneCore::ConfigItem.new(key: :bundle_version, env_name: "FL_HOCKEY_BUNDLE_VERSION", description: "The bundle_version of your application, required when using `create_update`", optional: true), FastlaneCore::ConfigItem.new(key: :public_identifier, env_name: "FL_HOCKEY_PUBLIC_IDENTIFIER", description: "App id of the app you are targeting, usually you won't need this value. Required, if `upload_dsym_only` set to `true`", optional: true), FastlaneCore::ConfigItem.new(key: :commit_sha, env_name: "FL_HOCKEY_COMMIT_SHA", description: "The Git commit SHA for this build", optional: true), FastlaneCore::ConfigItem.new(key: :repository_url, env_name: "FL_HOCKEY_REPOSITORY_URL", description: "The URL of your source repository", optional: true), FastlaneCore::ConfigItem.new(key: :build_server_url, env_name: "FL_HOCKEY_BUILD_SERVER_URL", description: "The URL of the build job on your build server", optional: true), FastlaneCore::ConfigItem.new(key: :upload_dsym_only, env_name: "FL_HOCKEY_UPLOAD_DSYM_ONLY", description: "Flag to upload only the dSYM file to hockey app", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :owner_id, env_name: "FL_HOCKEY_OWNER_ID", description: "ID for the owner of the app", optional: true), FastlaneCore::ConfigItem.new(key: :strategy, env_name: "FL_HOCKEY_STRATEGY", description: "Strategy: 'add' = to add the build as a new build even if it has the same build number (default); 'replace' = to replace a build with the same build number", default_value: "add", verify_block: proc do |value| UI.user_error!("Invalid value '#{value}' for key 'strategy'. Allowed values are 'add', 'replace'.") unless ['add', 'replace'].include?(value) end), FastlaneCore::ConfigItem.new(key: :timeout, env_name: "FL_HOCKEY_TIMEOUT", description: "Request timeout in seconds", type: Integer, optional: true), FastlaneCore::ConfigItem.new(key: :bypass_cdn, env_name: "FL_HOCKEY_BYPASS_CDN", description: "Flag to bypass Hockey CDN when it uploads successfully but reports error", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :dsa_signature, env_name: "FL_HOCKEY_DSA_SIGNATURE", description: "DSA signature for sparkle updates for macOS", default_value: "", optional: true) ] end def self.output [ ['HOCKEY_DOWNLOAD_LINK', 'The newly generated download link for this build'], ['HOCKEY_BUILD_INFORMATION', 'contains all keys/values from the HockeyApp API, like :title, :bundle_identifier'] ] end def self.author ["KrauseFx", "modzelewski", "lacostej"] end def self.is_supported?(platform) true end def self.details [ "HockeyApp will be no longer supported and will be transitioned into App Center on November 16, 2019.", "Please migrate over to [App Center](https://github.com/Microsoft/fastlane-plugin-appcenter/)", "", "Symbols will also be uploaded automatically if a `app.dSYM.zip` file is found next to `app.ipa`. In case it is located in a different place you can specify the path explicitly in the `:dsym` parameter.", "More information about the available options can be found in the [HockeyApp Docs](http://support.hockeyapp.net/kb/api/api-versions#upload-version)." ].join("\n") end def self.example_code [ 'hockey( api_token: "...", ipa: "./app.ipa", notes: "Changelog" )', 'hockey( api_token: "...", create_update: true, public_identifier: "....", bundle_short_version: "1.0.2", bundle_version: "1.0.2.145", ipa: "./my.msi", notes: "Changelog" )', '# You can bypass the CDN if you are uploading to Hockey and receive an SSL error (which can happen on corporate firewalls) hockey( api_token: "...", ipa: "./app.ipa", notes: "Changelog", bypass_cdn: true )' ] end def self.category :deprecated end def self.deprecated_notes [ "HockeyApp will be no longer supported and will be transitioned into App Center on November 16, 2019.", "Please migrate over to [App Center](https://github.com/Microsoft/fastlane-plugin-appcenter/)" ].join("\n") end end # rubocop:enable Metrics/ClassLength end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/team_id.rb
fastlane/lib/fastlane/actions/team_id.rb
module Fastlane module Actions module SharedValues end class TeamIdAction < Action def self.run(params) params = nil unless params.kind_of?(Array) team = (params || []).first UI.user_error!("Please pass your Team ID (e.g. team_id 'Q2CBPK58CA')") unless team.to_s.length > 0 UI.message("Setting Team ID to '#{team}' for all build steps") [:CERT_TEAM_ID, :SIGH_TEAM_ID, :PEM_TEAM_ID, :PRODUCE_TEAM_ID, :SIGH_TEAM_ID, :FASTLANE_TEAM_ID].each do |current| ENV[current.to_s] = team end end def self.author "KrauseFx" end def self.description "Specify the Team ID you want to use for the Apple Developer Portal" end def self.is_supported?(platform) platform == :ios end def self.example_code [ 'team_id("Q2CBPK58CA")' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/gym.rb
fastlane/lib/fastlane/actions/gym.rb
module Fastlane module Actions require 'fastlane/actions/build_app' class GymAction < BuildAppAction def self.description "Alias for the `build_app` action" end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/say.rb
fastlane/lib/fastlane/actions/say.rb
module Fastlane module Actions class SayAction < Action def self.run(params) text = params[:text] text = text.join(' ') text = text.tr("'", '"') if params[:mute] UI.message(text) return text else Actions.sh("say '#{text}'") end end def self.description "This action speaks the given text out loud" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :text, description: 'Text to be spoken out loud (as string or array of strings)', optional: false, type: Array), FastlaneCore::ConfigItem.new(key: :mute, env_name: "SAY_MUTE", description: 'If say should be muted with text printed out', optional: false, type: Boolean, default_value: false) ] end def self.is_supported?(platform) true end def self.author "KrauseFx" end def self.example_code [ 'say("I can speak")' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/snapshot.rb
fastlane/lib/fastlane/actions/snapshot.rb
module Fastlane module Actions require 'fastlane/actions/capture_ios_screenshots' class SnapshotAction < CaptureIosScreenshotsAction ##################################################### # @!group Documentation ##################################################### def self.description "Alias for the `capture_ios_screenshots` action" end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/create_xcframework.rb
fastlane/lib/fastlane/actions/create_xcframework.rb
module Fastlane module Actions module SharedValues XCFRAMEWORK_PATH ||= :XCFRAMEWORK_PATH end class CreateXcframeworkAction < Action PARAMETERS_TO_OPTIONS = { headers: '-headers', dsyms: '-debug-symbols' } def self.run(params) artifacts = normalized_artifact_info(params[:frameworks], [:dsyms]) || normalized_artifact_info(params[:frameworks_with_dsyms], [:dsyms]) || normalized_artifact_info(params[:libraries], [:headers, :dsyms]) || normalized_artifact_info(params[:libraries_with_headers_or_dsyms], [:headers, :dsyms]) UI.user_error!("Please provide either :frameworks, :frameworks_with_dsyms, :libraries or :libraries_with_headers_or_dsyms to be packaged into the xcframework") unless artifacts artifacts_type = params[:frameworks] || params[:frameworks_with_dsyms] ? '-framework' : '-library' create_command = ['xcodebuild', '-create-xcframework'] create_command << artifacts.map { |artifact, artifact_info| [artifacts_type, "\"#{artifact}\""] + artifact_info_as_options(artifact_info) }.flatten create_command << ['-output', "\"#{params[:output]}\""] create_command << ['-allow-internal-distribution'] if params[:allow_internal_distribution] if File.directory?(params[:output]) UI.message("Deleting existing: #{params[:output]}") FileUtils.remove_dir(params[:output]) end Actions.lane_context[SharedValues::XCFRAMEWORK_PATH] = params[:output] sh(create_command) end def self.normalized_artifact_info(artifacts_with_info, valid_info) case artifacts_with_info when Array artifacts_with_info.map { |artifact| [artifact, {}] }.to_h when Hash # Convert keys of artifact info to symbols ('dsyms' to :dsyms) and only keep keys we are interested in # For example with valid_info = [:dsyms] # { 'FrameworkA.framework' => { 'dsyms' => 'FrameworkA.framework.dSYM', 'foo' => bar } } # gets converted to # { 'FrameworkA.framework' => { dsyms: 'FrameworkA.framework.dSYM' } } artifacts_with_info.transform_values { |artifact_info| artifact_info.transform_keys(&:to_sym).slice(*valid_info) } else artifacts_with_info end end def self.artifact_info_as_options(artifact_info) artifact_info.map { |type, file| [PARAMETERS_TO_OPTIONS[type], "\"#{file}\""] }.flatten end def self.check_artifact_info(artifact_info) UI.user_error!("Headers and dSYMs information should be a hash") unless artifact_info.kind_of?(Hash) UI.user_error!("#{artifact_info[:headers]} doesn't exist or is not a directory") if artifact_info[:headers] && !File.directory?(artifact_info[:headers]) UI.user_error!("#{artifact_info[:dsyms]} doesn't seem to be a dSYM archive") if artifact_info[:dsyms] && !File.directory?(artifact_info[:dsyms]) end ##################################################### # @!group Documentation ##################################################### def self.description "Package multiple build configs of a library/framework into a single xcframework" end def self.details <<~DETAILS Utility for packaging multiple build configurations of a given library or framework into a single xcframework. If you want to package several frameworks just provide one of: * An array containing the list of frameworks using the :frameworks parameter (if they have no associated dSYMs): ['FrameworkA.framework', 'FrameworkB.framework'] * A hash containing the list of frameworks with their dSYMs using the :frameworks_with_dsyms parameter: { 'FrameworkA.framework' => {}, 'FrameworkB.framework' => { dsyms: 'FrameworkB.framework.dSYM' } } If you want to package several libraries just provide one of: * An array containing the list of libraries using the :libraries parameter (if they have no associated headers or dSYMs): ['LibraryA.so', 'LibraryB.so'] * A hash containing the list of libraries with their headers and dSYMs using the :libraries_with_headers_or_dsyms parameter: { 'LibraryA.so' => { dsyms: 'libraryA.so.dSYM' }, 'LibraryB.so' => { headers: 'headers' } } Finally specify the location of the xcframework to be generated using the :output parameter. DETAILS end def self.available_options [ FastlaneCore::ConfigItem.new(key: :frameworks, env_name: "FL_CREATE_XCFRAMEWORK_FRAMEWORKS", description: "Frameworks (without dSYMs) to add to the target xcframework", type: Array, optional: true, conflicting_options: [:frameworks_with_dsyms, :libraries, :libraries_with_headers_or_dsyms], verify_block: proc do |value| normalized_artifact_info(value, [:dsyms]).each do |framework, framework_info| UI.user_error!("#{framework} doesn't end with '.framework'. Is this really a framework?") unless framework.end_with?('.framework') UI.user_error!("Couldn't find framework at #{framework}") unless File.exist?(framework) UI.user_error!("#{framework} doesn't seem to be a framework") unless File.directory?(framework) check_artifact_info(framework_info) end end), FastlaneCore::ConfigItem.new(key: :frameworks_with_dsyms, env_name: "FL_CREATE_XCFRAMEWORK_FRAMEWORKS_WITH_DSYMS", description: "Frameworks (with dSYMs) to add to the target xcframework", type: Hash, optional: true, conflicting_options: [:frameworks, :libraries, :libraries_with_headers_or_dsyms], verify_block: proc do |value| normalized_artifact_info(value, [:dsyms]).each do |framework, framework_info| UI.user_error!("#{framework} doesn't end with '.framework'. Is this really a framework?") unless framework.end_with?('.framework') UI.user_error!("Couldn't find framework at #{framework}") unless File.exist?(framework) UI.user_error!("#{framework} doesn't seem to be a framework") unless File.directory?(framework) check_artifact_info(framework_info) end end), FastlaneCore::ConfigItem.new(key: :libraries, env_name: "FL_CREATE_XCFRAMEWORK_LIBRARIES", description: "Libraries (without headers or dSYMs) to add to the target xcframework", type: Array, optional: true, conflicting_options: [:frameworks, :frameworks_with_dsyms, :libraries_with_headers_or_dsyms], verify_block: proc do |value| normalized_artifact_info(value, [:headers, :dsyms]).each do |library, library_info| UI.user_error!("Couldn't find library at #{library}") unless File.exist?(library) check_artifact_info(library_info) end end), FastlaneCore::ConfigItem.new(key: :libraries_with_headers_or_dsyms, env_name: "FL_CREATE_XCFRAMEWORK_LIBRARIES_WITH_HEADERS_OR_DSYMS", description: "Libraries (with headers or dSYMs) to add to the target xcframework", type: Hash, optional: true, conflicting_options: [:frameworks, :frameworks_with_dsyms, :libraries], verify_block: proc do |value| normalized_artifact_info(value, [:headers, :dsyms]).each do |library, library_info| UI.user_error!("Couldn't find library at #{library}") unless File.exist?(library) check_artifact_info(library_info) end end), FastlaneCore::ConfigItem.new(key: :output, env_name: "FL_CREATE_XCFRAMEWORK_OUTPUT", description: "The path to write the xcframework to", type: String, optional: false), FastlaneCore::ConfigItem.new(key: :allow_internal_distribution, env_name: "FL_CREATE_XCFRAMEWORK_ALLOW_INTERNAL_DISTRIBUTION", description: "Specifies that the created xcframework contains information not suitable for public distribution", type: Boolean, optional: true, default_value: false) ] end def self.output [ ['XCFRAMEWORK_PATH', 'Location of the generated xcframework'] ] end def self.return_value end def self.example_code [ "create_xcframework(frameworks: ['FrameworkA.framework', 'FrameworkB.framework'], output: 'UniversalFramework.xcframework')", "create_xcframework(frameworks_with_dsyms: {'FrameworkA.framework' => {}, 'FrameworkB.framework' => { dsyms: 'FrameworkB.framework.dSYM' } }, output: 'UniversalFramework.xcframework')", "create_xcframework(libraries: ['LibraryA.so', 'LibraryB.so'], output: 'UniversalFramework.xcframework')", "create_xcframework(libraries_with_headers_or_dsyms: { 'LibraryA.so' => { dsyms: 'libraryA.so.dSYM' }, 'LibraryB.so' => { headers: 'LibraryBHeaders' } }, output: 'UniversalFramework.xcframework')" ] end def self.category :building end def self.authors ["jgongo"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/import_certificate.rb
fastlane/lib/fastlane/actions/import_certificate.rb
require 'shellwords' module Fastlane module Actions class ImportCertificateAction < Action def self.run(params) keychain_path = params[:keychain_path] || FastlaneCore::Helper.keychain_path(params[:keychain_name]) FastlaneCore::KeychainImporter.import_file(params[:certificate_path], keychain_path, keychain_password: params[:keychain_password], certificate_password: params[:certificate_password], output: params[:log_output]) end def self.description "Import certificate from inputfile into a keychain" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :certificate_path, description: "Path to certificate", optional: false), FastlaneCore::ConfigItem.new(key: :certificate_password, description: "Certificate password", sensitive: true, default_value: "", optional: true), FastlaneCore::ConfigItem.new(key: :keychain_name, env_name: "KEYCHAIN_NAME", description: "Keychain the items should be imported to", optional: false), FastlaneCore::ConfigItem.new(key: :keychain_path, env_name: "KEYCHAIN_PATH", description: "Path to the Keychain file to which the items should be imported", optional: true), FastlaneCore::ConfigItem.new(key: :keychain_password, env_name: "FL_IMPORT_CERT_KEYCHAIN_PASSWORD", description: "The password for the keychain. Note that for the login keychain this is your user's password", sensitive: true, optional: true), FastlaneCore::ConfigItem.new(key: :log_output, description: "If output should be logged to the console", type: Boolean, default_value: false, optional: true) ] end def self.authors ["gin0606"] end def self.is_supported?(platform) true end def self.details "Import certificates (and private keys) into the current default keychain. Use the `create_keychain` action to create a new keychain." end def self.example_code [ 'import_certificate(certificate_path: "certs/AppleWWDRCA6.cer")', 'import_certificate( certificate_path: "certs/dist.p12", certificate_password: ENV["CERTIFICATE_PASSWORD"] || "default" )', 'import_certificate( certificate_path: "certs/development.cer" )' ] end def self.category :code_signing end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/deploygate.rb
fastlane/lib/fastlane/actions/deploygate.rb
module Fastlane module Actions module SharedValues DEPLOYGATE_URL = :DEPLOYGATE_URL DEPLOYGATE_REVISION = :DEPLOYGATE_REVISION # auto increment revision number DEPLOYGATE_APP_INFO = :DEPLOYGATE_APP_INFO # contains app revision, bundle identifier, etc. end class DeploygateAction < Action DEPLOYGATE_URL_BASE = 'https://deploygate.com' def self.is_supported?(platform) [:ios, :android].include?(platform) end def self.upload_build(api_token, user_name, binary, options) require 'faraday' require 'faraday_middleware' connection = Faraday.new(url: DEPLOYGATE_URL_BASE, request: { timeout: 120 }) do |builder| builder.request(:multipart) builder.request(:json) builder.response(:json, content_type: /\bjson$/) builder.use(FaradayMiddleware::FollowRedirects) builder.adapter(:net_http) end options.update({ token: api_token, file: Faraday::UploadIO.new(binary, 'application/octet-stream'), message: options[:message] || '' }) options[:disable_notify] = 'yes' if options[:disable_notify] connection.post("/api/users/#{user_name}/apps", options) rescue Faraday::TimeoutError UI.crash!("Timed out while uploading build. Check https://deploygate.com/ to see if the upload was completed.") end def self.run(options) # Available options: https://deploygate.com/docs/api UI.success('Starting with app upload to DeployGate... this could take some time ⏳') api_token = options[:api_token] user_name = options[:user] binary = options[:ipa] || options[:apk] upload_options = options.values.select do |key, _| [:message, :distribution_key, :release_note, :disable_notify, :distribution_name].include?(key) end UI.user_error!('missing `ipa` and `apk`. deploygate action needs least one.') unless binary return binary if Helper.test? response = self.upload_build(api_token, user_name, binary, upload_options) if parse_response(response) UI.message("DeployGate URL: #{Actions.lane_context[SharedValues::DEPLOYGATE_URL]}") UI.success("Build successfully uploaded to DeployGate as revision \##{Actions.lane_context[SharedValues::DEPLOYGATE_REVISION]}!") else UI.user_error!("Error when trying to upload app to DeployGate") end end def self.parse_response(response) if response.body && response.body.key?('error') if response.body['error'] UI.error("Error uploading to DeployGate: #{response.body['message']}") help_message(response) return else res = response.body['results'] url = DEPLOYGATE_URL_BASE + res['path'] Actions.lane_context[SharedValues::DEPLOYGATE_URL] = url Actions.lane_context[SharedValues::DEPLOYGATE_REVISION] = res['revision'] Actions.lane_context[SharedValues::DEPLOYGATE_APP_INFO] = res end else UI.error("Error uploading to DeployGate: #{response.body}") return end true end private_class_method :parse_response def self.help_message(response) message = case response.body['message'] when 'you are not authenticated' 'Invalid API Token specified.' when 'application create error: permit' 'Access denied: May be trying to upload to wrong user or updating app you join as a tester?' when 'application create error: limit' 'Plan limit: You have reached to the limit of current plan or your plan was expired.' end UI.error(message) if message end private_class_method :help_message def self.description "Upload a new build to [DeployGate](https://deploygate.com/)" end def self.details [ "You can retrieve your username and API token on [your settings page](https://deploygate.com/settings).", "More information about the available options can be found in the [DeployGate Push API document](https://deploygate.com/docs/api)." ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :api_token, env_name: "DEPLOYGATE_API_TOKEN", description: "Deploygate API Token", sensitive: true, verify_block: proc do |value| UI.user_error!("No API Token for DeployGate given, pass using `api_token: 'token'`") unless value.to_s.length > 0 end), FastlaneCore::ConfigItem.new(key: :user, env_name: "DEPLOYGATE_USER", description: "Target username or organization name", verify_block: proc do |value| UI.user_error!("No User for DeployGate given, pass using `user: 'user'`") unless value.to_s.length > 0 end), FastlaneCore::ConfigItem.new(key: :ipa, env_name: "DEPLOYGATE_IPA_PATH", description: "Path to your IPA file. Optional if you use the _gym_ or _xcodebuild_ action", default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH], default_value_dynamic: true, optional: true, verify_block: proc do |value| UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :apk, env_name: "DEPLOYGATE_APK_PATH", description: "Path to your APK file", default_value: Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH], default_value_dynamic: true, optional: true, verify_block: proc do |value| UI.user_error!("Couldn't find apk file at path '#{value}'") unless File.exist?(value) end), FastlaneCore::ConfigItem.new(key: :message, env_name: "DEPLOYGATE_MESSAGE", description: "Release Notes", default_value: "No changelog provided"), FastlaneCore::ConfigItem.new(key: :distribution_key, optional: true, env_name: "DEPLOYGATE_DISTRIBUTION_KEY", sensitive: true, description: "Target Distribution Key"), FastlaneCore::ConfigItem.new(key: :release_note, optional: true, env_name: "DEPLOYGATE_RELEASE_NOTE", description: "Release note for distribution page"), FastlaneCore::ConfigItem.new(key: :disable_notify, optional: true, type: Boolean, default_value: false, env_name: "DEPLOYGATE_DISABLE_NOTIFY", description: "Disables Push notification emails"), FastlaneCore::ConfigItem.new(key: :distribution_name, optional: true, env_name: "DEPLOYGATE_DISTRIBUTION_NAME", description: "Target Distribution Name") ] end def self.output [ ['DEPLOYGATE_URL', 'URL of the newly uploaded build'], ['DEPLOYGATE_REVISION', 'auto incremented revision number'], ['DEPLOYGATE_APP_INFO', 'Contains app revision, bundle identifier, etc.'] ] end def self.example_code [ 'deploygate( api_token: "...", user: "target username or organization name", ipa: "./ipa_file.ipa", message: "Build #{lane_context[SharedValues::BUILD_NUMBER]}", distribution_key: "(Optional) Target Distribution Key", distribution_name: "(Optional) Target Distribution Name" )', 'deploygate( api_token: "...", user: "target username or organization name", apk: "./apk_file.apk", message: "Build #{lane_context[SharedValues::BUILD_NUMBER]}", distribution_key: "(Optional) Target Distribution Key", distribution_name: "(Optional) Target Distribution Name" )' ] end def self.category :beta end def self.authors ["tnj", "tomorrowkey"] end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/google_play_track_release_names.rb
fastlane/lib/fastlane/actions/google_play_track_release_names.rb
module Fastlane module Actions class GooglePlayTrackReleaseNamesAction < Action # Supply::Options.available_options keys that apply to this action. OPTIONS = [ :package_name, :track, :key, :issuer, :json_key, :json_key_data, :root_url, :timeout ] def self.run(params) require 'supply' require 'supply/options' require 'supply/reader' Supply.config = params release_names = Supply::Reader.new.track_release_names || [] return release_names.compact end ##################################################### # @!group Documentation ##################################################### def self.description "Retrieves release names for a Google Play track" end def self.details "More information: [https://docs.fastlane.tools/actions/supply/](https://docs.fastlane.tools/actions/supply/)" end def self.available_options require 'supply' require 'supply/options' Supply::Options.available_options.select do |option| OPTIONS.include?(option.key) end end def self.output end def self.return_value "Array of strings representing the release names for the given Google Play track" end def self.authors ["raldred"] end def self.is_supported?(platform) platform == :android end def self.example_code [ 'google_play_track_release_names' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/xcov.rb
fastlane/lib/fastlane/actions/xcov.rb
module Fastlane module Actions class XcovAction < Action def self.run(values) Actions.verify_gem!('xcov') require 'xcov' if values[:xccov_file_direct_path].nil? && (path = Actions.lane_context[SharedValues::SCAN_GENERATED_XCRESULT_PATH]) UI.verbose("Pulling xcov 'xccov_file_direct_path' from SharedValues::SCAN_GENERATED_XCRESULT_PATH") values[:xccov_file_direct_path] = path end Xcov::Manager.new(values).run end def self.description "Nice code coverage reports without hassle" end def self.details [ "Create nice code coverage reports and post coverage summaries on Slack *(xcov gem is required)*.", "More information: [https://github.com/fastlane-community/xcov](https://github.com/fastlane-community/xcov)." ].join("\n") end def self.author "nakiostudio" end def self.available_options return [] unless Helper.mac? begin Gem::Specification.find_by_name('xcov') rescue Gem::LoadError # Catch missing gem exception and return empty array # to avoid unused_options_spec failure return [] end require 'xcov' Xcov::Options.available_options end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'xcov( workspace: "YourWorkspace.xcworkspace", scheme: "YourScheme", output_directory: "xcov_output" )' ] end def self.category :testing end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/puts.rb
fastlane/lib/fastlane/actions/puts.rb
module Fastlane module Actions class PutsAction < Action def self.run(params) # display text from the message param (most likely coming from Swift) # if called like `puts 'hi'` then params won't be a configuration item, so we have to check if params.kind_of?(FastlaneCore::Configuration) && params[:message] UI.message(params[:message]) return end # no parameter included in the call means treat this like a normal fastlane ruby call UI.message(params.join(' ')) end ##################################################### # @!group Documentation ##################################################### def self.description "Prints out the given text" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :message, env_name: "FL_PUTS_MESSAGE", description: "Message to be printed out", optional: true) ] end def self.authors ["KrauseFx"] end def self.is_supported?(platform) true end def self.alias_used(action_alias, params) if !params.kind_of?(FastlaneCore::Configuration) || params[:message].nil? UI.important("#{action_alias} called, please use 'puts' instead!") end end def self.aliases ["println", "echo"] end # We don't want to show this as step def self.step_text nil end def self.example_code [ 'puts "Hi there"' ] end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/gradle.rb
fastlane/lib/fastlane/actions/gradle.rb
require 'pathname' require 'shellwords' module Fastlane module Actions module SharedValues GRADLE_APK_OUTPUT_PATH = :GRADLE_APK_OUTPUT_PATH GRADLE_ALL_APK_OUTPUT_PATHS = :GRADLE_ALL_APK_OUTPUT_PATHS GRADLE_AAB_OUTPUT_PATH = :GRADLE_AAB_OUTPUT_PATH GRADLE_ALL_AAB_OUTPUT_PATHS = :GRADLE_ALL_AAB_OUTPUT_PATHS GRADLE_OUTPUT_JSON_OUTPUT_PATH = :GRADLE_OUTPUT_JSON_OUTPUT_PATH GRADLE_ALL_OUTPUT_JSON_OUTPUT_PATHS = :GRADLE_ALL_OUTPUT_JSON_OUTPUT_PATHS GRADLE_MAPPING_TXT_OUTPUT_PATH = :GRADLE_MAPPING_TXT_OUTPUT_PATH GRADLE_ALL_MAPPING_TXT_OUTPUT_PATHS = :GRADLE_ALL_MAPPING_TXT_OUTPUT_PATHS GRADLE_FLAVOR = :GRADLE_FLAVOR GRADLE_BUILD_TYPE = :GRADLE_BUILD_TYPE end class GradleAction < Action # rubocop:disable Metrics/PerceivedComplexity def self.run(params) task = params[:task] flavor = params[:flavor] build_type = params[:build_type] tasks = params[:tasks] gradle_task = gradle_task(task, flavor, build_type, tasks) UI.user_error!('Please pass a gradle task or tasks') if gradle_task.empty? project_dir = params[:project_dir] gradle_path_param = params[:gradle_path] || './gradlew' # Get the path to gradle, if it's an absolute path we take it as is, if it's relative we assume it's relative to the project_dir gradle_path = if Pathname.new(gradle_path_param).absolute? File.expand_path(gradle_path_param) else File.expand_path(File.join(project_dir, gradle_path_param)) end # Ensure we ended up with a valid path to gradle UI.user_error!("Couldn't find gradlew at path '#{File.expand_path(gradle_path)}'") unless File.exist?(gradle_path) # Construct our flags flags = [] flags << "-p #{project_dir.shellescape}" flags << params[:properties].map { |k, v| "-P#{k.to_s.shellescape}=#{v.to_s.shellescape}" }.join(' ') unless params[:properties].nil? flags << params[:system_properties].map { |k, v| "-D#{k.to_s.shellescape}=#{v.to_s.shellescape}" }.join(' ') unless params[:system_properties].nil? flags << params[:flags] unless params[:flags].nil? # Run the actual gradle task gradle = Helper::GradleHelper.new(gradle_path: gradle_path) # If these were set as properties, then we expose them back out as they might be useful to others Actions.lane_context[SharedValues::GRADLE_BUILD_TYPE] = build_type if build_type Actions.lane_context[SharedValues::GRADLE_FLAVOR] = flavor if flavor # We run the actual gradle task result = gradle.trigger(task: gradle_task, serial: params[:serial], flags: flags.join(' '), print_command: params[:print_command], print_command_output: params[:print_command_output]) # If we didn't build, then we return now, as it makes no sense to search for apk's in a non-`assemble` or non-`build` scenario return result unless gradle_task =~ /\b(assemble)/ || gradle_task =~ /\b(bundle)/ apk_search_path = File.join(project_dir, '**', 'build', 'outputs', 'apk', '**', '*.apk') aab_search_path = File.join(project_dir, '**', 'build', 'outputs', 'bundle', '**', '*.aab') output_json_search_path = File.join(project_dir, '**', 'build', 'outputs', 'apk', '**', 'output*.json') # output.json in Android Studio 3 and output-metadata.json in Android Studio 4 mapping_txt_search_path = File.join(project_dir, '**', 'build', 'outputs', 'mapping', '**', 'mapping.txt') # Our apk/aab is now built, but there might actually be multiple ones that were built if a flavor was not specified in a multi-flavor project (e.g. `assembleRelease`) # However, we're not interested in unaligned apk's... new_apks = Dir[apk_search_path].reject { |path| path =~ /^.*-unaligned.apk$/i } new_apks = new_apks.map { |path| File.expand_path(path) } new_aabs = Dir[aab_search_path] new_aabs = new_aabs.map { |path| File.expand_path(path) } new_output_jsons = Dir[output_json_search_path] new_output_jsons = new_output_jsons.map { |path| File.expand_path(path) } new_mapping_txts = Dir[mapping_txt_search_path] new_mapping_txts = new_mapping_txts.map { |path| File.expand_path(path) } # We expose all of these new apks and aabs Actions.lane_context[SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS] = new_apks Actions.lane_context[SharedValues::GRADLE_ALL_AAB_OUTPUT_PATHS] = new_aabs Actions.lane_context[SharedValues::GRADLE_ALL_OUTPUT_JSON_OUTPUT_PATHS] = new_output_jsons Actions.lane_context[SharedValues::GRADLE_ALL_MAPPING_TXT_OUTPUT_PATHS] = new_mapping_txts # We also take the most recent apk and aab to return as SharedValues::GRADLE_APK_OUTPUT_PATH and SharedValues::GRADLE_AAB_OUTPUT_PATH # This is the one that will be relevant for most projects that just build a single build variant (flavor + build type combo). # In multi build variants this value is undefined last_apk_path = new_apks.sort_by(&File.method(:mtime)).last last_aab_path = new_aabs.sort_by(&File.method(:mtime)).last last_output_json_path = new_output_jsons.sort_by(&File.method(:mtime)).last last_mapping_txt_path = new_mapping_txts.sort_by(&File.method(:mtime)).last Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH] = File.expand_path(last_apk_path) if last_apk_path Actions.lane_context[SharedValues::GRADLE_AAB_OUTPUT_PATH] = File.expand_path(last_aab_path) if last_aab_path Actions.lane_context[SharedValues::GRADLE_OUTPUT_JSON_OUTPUT_PATH] = File.expand_path(last_output_json_path) if last_output_json_path Actions.lane_context[SharedValues::GRADLE_MAPPING_TXT_OUTPUT_PATH] = File.expand_path(last_mapping_txt_path) if last_mapping_txt_path # Give a helpful message in case there were no new apks or aabs. Remember we're only running this code when assembling, in which case we certainly expect there to be an apk or aab UI.message('Couldn\'t find any new signed apk files...') if new_apks.empty? && new_aabs.empty? return result end # rubocop:enable Metrics/PerceivedComplexity def self.gradle_task(task, flavor, build_type, tasks) gradle_task = [task, flavor, build_type].join if gradle_task.empty? && !tasks.nil? gradle_task = tasks.join(' ') end gradle_task end def self.step_text(params) task = params[:task] flavor = params[:flavor] build_type = params[:build_type] tasks = params[:tasks] gradle_task = gradle_task(task, flavor, build_type, tasks) return gradle_task end ##################################################### # @!group Documentation ##################################################### def self.description 'All gradle related actions, including building and testing your Android app' end def self.details 'Run `./gradlew tasks` to get a list of all available gradle tasks for your project' end def self.available_options [ FastlaneCore::ConfigItem.new(key: :task, env_name: 'FL_GRADLE_TASK', description: 'The gradle task you want to execute, e.g. `assemble`, `bundle` or `test`. For tasks such as `assembleMyFlavorRelease` you should use gradle(task: \'assemble\', flavor: \'Myflavor\', build_type: \'Release\')', conflicting_options: [:tasks], optional: true), FastlaneCore::ConfigItem.new(key: :flavor, env_name: 'FL_GRADLE_FLAVOR', description: 'The flavor that you want the task for, e.g. `MyFlavor`. If you are running the `assemble` task in a multi-flavor project, and you rely on Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH] then you must specify a flavor here or else this value will be undefined', optional: true), FastlaneCore::ConfigItem.new(key: :build_type, env_name: 'FL_GRADLE_BUILD_TYPE', description: 'The build type that you want the task for, e.g. `Release`. Useful for some tasks such as `assemble`', optional: true), FastlaneCore::ConfigItem.new(key: :tasks, type: Array, env_name: 'FL_GRADLE_TASKS', description: 'The multiple gradle tasks that you want to execute, e.g. `[assembleDebug, bundleDebug]`', conflicting_options: [:task], optional: true), FastlaneCore::ConfigItem.new(key: :flags, env_name: 'FL_GRADLE_FLAGS', description: 'All parameter flags you want to pass to the gradle command, e.g. `--exitcode --xml file.xml`', optional: true), FastlaneCore::ConfigItem.new(key: :project_dir, env_name: 'FL_GRADLE_PROJECT_DIR', description: 'The root directory of the gradle project', default_value: '.'), FastlaneCore::ConfigItem.new(key: :gradle_path, env_name: 'FL_GRADLE_PATH', description: 'The path to your `gradlew`. If you specify a relative path, it is assumed to be relative to the `project_dir`', optional: true), FastlaneCore::ConfigItem.new(key: :properties, env_name: 'FL_GRADLE_PROPERTIES', description: 'Gradle properties to be exposed to the gradle script', optional: true, type: Hash), FastlaneCore::ConfigItem.new(key: :system_properties, env_name: 'FL_GRADLE_SYSTEM_PROPERTIES', description: 'Gradle system properties to be exposed to the gradle script', optional: true, type: Hash), FastlaneCore::ConfigItem.new(key: :serial, env_name: 'FL_ANDROID_SERIAL', description: 'Android serial, which device should be used for this command', default_value: ''), FastlaneCore::ConfigItem.new(key: :print_command, env_name: 'FL_GRADLE_PRINT_COMMAND', description: 'Control whether the generated Gradle command is printed as output before running it (true/false)', type: Boolean, default_value: true), FastlaneCore::ConfigItem.new(key: :print_command_output, env_name: 'FL_GRADLE_PRINT_COMMAND_OUTPUT', description: 'Control whether the output produced by given Gradle command is printed while running (true/false)', type: Boolean, default_value: true) ] end def self.output [ ['GRADLE_APK_OUTPUT_PATH', 'The path to the newly generated apk file. Undefined in a multi-variant assemble scenario'], ['GRADLE_ALL_APK_OUTPUT_PATHS', 'When running a multi-variant `assemble`, the array of signed apk\'s that were generated'], ['GRADLE_FLAVOR', 'The flavor, e.g. `MyFlavor`'], ['GRADLE_BUILD_TYPE', 'The build type, e.g. `Release`'], ['GRADLE_AAB_OUTPUT_PATH', 'The path to the most recent Android app bundle'], ['GRADLE_ALL_AAB_OUTPUT_PATHS', 'The paths to the most recent Android app bundles'], ['GRADLE_OUTPUT_JSON_OUTPUT_PATH', 'The path to the most recent output.json file'], ['GRADLE_ALL_OUTPUT_JSON_OUTPUT_PATHS', 'The path to the newly generated output.json files'], ['GRADLE_MAPPING_TXT_OUTPUT_PATH', 'The path to the most recent mapping.txt file'], ['GRADLE_ALL_MAPPING_TXT_OUTPUT_PATHS', 'The path to the newly generated mapping.txt files'] ] end def self.return_value 'The output of running the gradle task' end def self.authors ['KrauseFx', 'lmirosevic'] end def self.is_supported?(platform) [:ios, :android].include?(platform) # we support iOS as cross platforms apps might want to call `gradle` also end def self.example_code [ 'gradle( task: "assemble", flavor: "WorldDomination", build_type: "Release" ) ``` To build an AAB use: ```ruby gradle( task: "bundle", flavor: "WorldDomination", build_type: "Release" ) ``` You can pass multiple gradle tasks: ```ruby gradle( tasks: ["assembleDebug", "bundleDebug"] ) ``` You can pass properties to gradle: ```ruby gradle( # ... properties: { "exampleNumber" => 100, "exampleString" => "1.0.0", # ... } ) ``` You can use this to change the version code and name of your app: ```ruby gradle( # ... properties: { "android.injected.version.code" => 100, "android.injected.version.name" => "1.0.0", # ... } ) ``` You can use this to automatically [sign and zipalign](https://developer.android.com/studio/publish/app-signing.html) your app: ```ruby gradle( task: "assemble", build_type: "Release", print_command: false, properties: { "android.injected.signing.store.file" => "keystore.jks", "android.injected.signing.store.password" => "store_password", "android.injected.signing.key.alias" => "key_alias", "android.injected.signing.key.password" => "key_password", } ) ``` If you need to pass sensitive information through the `gradle` action, and don\'t want the generated command to be printed before it is run, you can suppress that: ```ruby gradle( # ... print_command: false ) ``` You can also suppress printing the output generated by running the generated Gradle command: ```ruby gradle( # ... print_command_output: false ) ``` To pass any other CLI flags to gradle use: ```ruby gradle( # ... flags: "--exitcode --xml file.xml" ) ``` Delete the build directory, generated APKs and AABs ```ruby gradle( task: "clean" )' ] end def self.category :building end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/xcode_install.rb
fastlane/lib/fastlane/actions/xcode_install.rb
module Fastlane module Actions module SharedValues XCODE_INSTALL_XCODE_PATH = :XCODE_INSTALL_XCODE_PATH end class XcodeInstallAction < Action def self.run(params) Actions.verify_gem!('xcode-install') ENV["XCODE_INSTALL_USER"] = params[:username] ENV["XCODE_INSTALL_TEAM_ID"] = params[:team_id] require 'xcode/install' installer = XcodeInstall::Installer.new if installer.installed?(params[:version]) UI.success("Xcode #{params[:version]} is already installed ✨") else installer.install_version(params[:version], true, true, true, true, nil, true, nil, params[:download_retry_attempts]) end xcode = installer.installed_versions.find { |x| x.version == params[:version] } UI.user_error!("Could not find Xcode with version '#{params[:version]}'") unless xcode UI.message("Using Xcode #{params[:version]} on path '#{xcode.path}'") xcode.approve_license ENV["DEVELOPER_DIR"] = File.join(xcode.path, "/Contents/Developer") Actions.lane_context[SharedValues::XCODE_INSTALL_XCODE_PATH] = xcode.path return xcode.path end ##################################################### # @!group Documentation ##################################################### def self.description "Make sure a certain version of Xcode is installed" end def self.details "Makes sure a specific version of Xcode is installed. If that's not the case, it will automatically be downloaded by the [xcode_install](https://github.com/neonichu/xcode-install) gem. This will make sure to use the correct Xcode for later actions." end def self.available_options user = CredentialsManager::AppfileConfig.try_fetch_value(:apple_dev_portal_id) user ||= CredentialsManager::AppfileConfig.try_fetch_value(:apple_id) [ FastlaneCore::ConfigItem.new(key: :version, env_name: "FL_XCODE_VERSION", description: "The version number of the version of Xcode to install"), FastlaneCore::ConfigItem.new(key: :username, short_option: "-u", env_name: "XCODE_INSTALL_USER", description: "Your Apple ID Username", default_value: user, default_value_dynamic: true), FastlaneCore::ConfigItem.new(key: :team_id, short_option: "-b", env_name: "XCODE_INSTALL_TEAM_ID", description: "The ID of your team if you're in multiple teams", optional: true, code_gen_sensitive: true, default_value: CredentialsManager::AppfileConfig.try_fetch_value(:team_id), default_value_dynamic: true), FastlaneCore::ConfigItem.new(key: :download_retry_attempts, env_name: "XCODE_INSTALL_DOWNLOAD_RETRY_ATTEMPTS", description: "Number of times the download will be retried in case of failure", type: Integer, default_value: 3) ] end def self.output [ ['XCODE_INSTALL_XCODE_PATH', 'The path to the newly installed Xcode'] ] end def self.return_value "The path to the newly installed Xcode version" end def self.return_type :string end def self.authors ["Krausefx"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'xcode_install(version: "7.1")' ] end def self.category :deprecated end def self.deprecated_notes "The xcode-install gem, which this action depends on, has been sunset. Please migrate to [xcodes](https://docs.fastlane.tools/actions/xcodes). You can find a migration guide here: [xcpretty/xcode-install/MIGRATION.md](https://github.com/xcpretty/xcode-install/blob/master/MIGRATION.md)" end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/apteligent.rb
fastlane/lib/fastlane/actions/apteligent.rb
module Fastlane module Actions class ApteligentAction < Action def self.run(params) command = [] command << "curl" command += upload_options(params) command << upload_url(params[:app_id].shellescape) # Fastlane::Actions.sh has buffering issues, no progress bar is shown in real time # will reenable it when it is fixed # result = Fastlane::Actions.sh(command.join(' '), log: false) shell_command = command.join(' ') return shell_command if Helper.test? result = Actions.sh(shell_command) fail_on_error(result) end def self.fail_on_error(result) if result != "200" UI.crash!("Server error, failed to upload the dSYM file.") else UI.success('dSYM successfully uploaded to Apteligent!') end end def self.upload_url(app_id) "https://api.crittercism.com/api_beta/dsym/#{app_id}" end def self.dsym_path(params) file_path = params[:dsym] file_path ||= Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH] || ENV[SharedValues::DSYM_OUTPUT_PATH.to_s] file_path ||= Actions.lane_context[SharedValues::DSYM_ZIP_PATH] || ENV[SharedValues::DSYM_ZIP_PATH.to_s] if file_path expanded_file_path = File.expand_path(file_path) UI.user_error!("Couldn't find file at path '#{expanded_file_path}'") unless File.exist?(expanded_file_path) return expanded_file_path else UI.user_error!("Couldn't find dSYM file") end end def self.upload_options(params) file_path = dsym_path(params).shellescape # rubocop: disable Style/FormatStringToken options = [] options << "--write-out %{http_code} --silent --output /dev/null" options << "-F dsym=@#{file_path}" options << "-F key=#{params[:api_key].shellescape}" options # rubocop: enable Style/FormatStringToken end ##################################################### # @!group Documentation ##################################################### def self.description "Upload dSYM file to [Apteligent (Crittercism)](http://www.apteligent.com/)" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :dsym, env_name: "FL_APTELIGENT_FILE", description: "dSYM.zip file to upload to Apteligent", optional: true), FastlaneCore::ConfigItem.new(key: :app_id, env_name: "FL_APTELIGENT_APP_ID", description: "Apteligent App ID key e.g. 569f5c87cb99e10e00c7xxxx", optional: false), FastlaneCore::ConfigItem.new(key: :api_key, env_name: "FL_APTELIGENT_API_KEY", sensitive: true, code_gen_sensitive: true, description: "Apteligent App API key e.g. IXPQIi8yCbHaLliqzRoo065tH0lxxxxx", optional: false) ] end def self.authors ["Mo7amedFouad"] end def self.is_supported?(platform) platform == :ios end def self.example_code [ 'apteligent( app_id: "...", api_key: "..." )' ] end def self.category :beta end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/prompt.rb
fastlane/lib/fastlane/actions/prompt.rb
module Fastlane module Actions class PromptAction < Action def self.run(params) if params[:boolean] return params[:ci_input] unless UI.interactive? return UI.confirm(params[:text]) end UI.message(params[:text]) return params[:ci_input] unless UI.interactive? if params[:multi_line_end_keyword] # Multi line end_tag = params[:multi_line_end_keyword] UI.important("Submit inputs using \"#{params[:multi_line_end_keyword]}\"") user_input = "" loop do line = STDIN.gets # returns `nil` if called at end of file break unless line end_tag_index = line.index(end_tag) if end_tag_index.nil? user_input << line else user_input << line.slice(0, end_tag_index) user_input = user_input.strip break end end else # Standard one line input if params[:secure_text] user_input = STDIN.noecho(&:gets).chomp while (user_input || "").length == 0 else user_input = STDIN.gets.chomp.strip while (user_input || "").length == 0 end end return user_input end ##################################################### # @!group Documentation ##################################################### def self.description "Ask the user for a value or for confirmation" end def self.details [ "You can use `prompt` to ask the user for a value or to just let the user confirm the next step.", "When this is executed on a CI service, the passed `ci_input` value will be returned.", "This action also supports multi-line inputs using the `multi_line_end_keyword` option." ].join("\n") end def self.available_options [ FastlaneCore::ConfigItem.new(key: :text, description: "The text that will be displayed to the user", default_value: "Please enter some text: "), FastlaneCore::ConfigItem.new(key: :ci_input, description: "The default text that will be used when being executed on a CI service", default_value: ''), FastlaneCore::ConfigItem.new(key: :boolean, description: "Is that a boolean question (yes/no)? This will add (y/n) at the end", default_value: false, type: Boolean), FastlaneCore::ConfigItem.new(key: :secure_text, description: "Is that a secure text (yes/no)?", default_value: false, type: Boolean), FastlaneCore::ConfigItem.new(key: :multi_line_end_keyword, description: "Enable multi-line inputs by providing an end text (e.g. 'END') which will stop the user input", optional: true) ] end def self.output [] end def self.authors ["KrauseFx"] end def self.is_supported?(platform) true end def self.example_code [ 'changelog = prompt(text: "Changelog: ")', 'changelog = prompt( text: "Changelog: ", multi_line_end_keyword: "END" ) pilot(changelog: changelog)' ] end def self.sample_return_value "User Content\nWithNewline" end def self.return_type :string end def self.category :misc end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/splunkmint.rb
fastlane/lib/fastlane/actions/splunkmint.rb
module Fastlane module Actions class SplunkmintAction < Action def self.run(params) command = [] command << "curl" command << verbose(params) command += proxy_options(params) command += upload_options(params) command << upload_url command << upload_progress(params) # Fastlane::Actions.sh has buffering issues, no progress bar is shown in real time # will reenable it when it is fixed # result = Fastlane::Actions.sh(command.join(' '), log: false) shell_command = command.join(' ') result = Helper.test? ? shell_command : `#{shell_command}` fail_on_error(result) result end def self.fail_on_error(result) if result.include?("error") UI.user_error!("Server error, failed to upload the dSYM file") end end def self.upload_url "https://ios.splkmobile.com/api/v1/dsyms/upload" end def self.verbose(params) params[:verbose] ? "--verbose" : "" end def self.upload_progress(params) params[:upload_progress] ? " --progress-bar -o /dev/null --no-buffer" : "" end def self.dsym_path(params) file_path = params[:dsym] file_path ||= Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH] || ENV[SharedValues::DSYM_OUTPUT_PATH.to_s] file_path ||= Actions.lane_context[SharedValues::DSYM_ZIP_PATH] || ENV[SharedValues::DSYM_ZIP_PATH.to_s] if file_path expanded_file_path = File.expand_path(file_path) UI.user_error!("Couldn't find file at path '#{expanded_file_path}'") unless File.exist?(expanded_file_path) return expanded_file_path else UI.user_error!("Couldn't find any dSYM file") end end def self.upload_options(params) file_path = dsym_path(params).shellescape options = [] options << "-F file=@#{file_path}" options << "--header 'X-Splunk-Mint-Auth-Token: #{params[:api_token].shellescape}'" options << "--header 'X-Splunk-Mint-apikey: #{params[:api_key].shellescape}'" options end def self.proxy_options(params) options = [] if params[:proxy_address] && params[:proxy_port] && params[:proxy_username] && params[:proxy_password] options << "-x #{params[:proxy_address].shellescape}:#{params[:proxy_port].shellescape}" options << "--proxy-user #{params[:proxy_username].shellescape}:#{params[:proxy_password].shellescape}" end options end ##################################################### # @!group Documentation ##################################################### def self.description "Upload dSYM file to [Splunk MINT](https://mint.splunk.com/)" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :dsym, env_name: "FL_SPLUNKMINT_FILE", description: "dSYM.zip file to upload to Splunk MINT", optional: true), FastlaneCore::ConfigItem.new(key: :api_key, env_name: "FL_SPLUNKMINT_API_KEY", description: "Splunk MINT App API key e.g. f57a57ca", sensitive: true, optional: false), FastlaneCore::ConfigItem.new(key: :api_token, env_name: "FL_SPLUNKMINT_API_TOKEN", description: "Splunk MINT API token e.g. e05ba40754c4869fb7e0b61", sensitive: true, optional: false), FastlaneCore::ConfigItem.new(key: :verbose, env_name: "FL_SPLUNKMINT_VERBOSE", description: "Make detailed output", type: Boolean, default_value: false, optional: true), FastlaneCore::ConfigItem.new(key: :upload_progress, env_name: "FL_SPLUNKMINT_UPLOAD_PROGRESS", description: "Show upload progress", type: Boolean, default_value: false, optional: true), FastlaneCore::ConfigItem.new(key: :proxy_username, env_name: "FL_SPLUNKMINT_PROXY_USERNAME", description: "Proxy username", optional: true), FastlaneCore::ConfigItem.new(key: :proxy_password, env_name: "FL_SPLUNKMINT_PROXY_PASSWORD", sensitive: true, description: "Proxy password", optional: true), FastlaneCore::ConfigItem.new(key: :proxy_address, env_name: "FL_SPLUNKMINT_PROXY_ADDRESS", description: "Proxy address", optional: true), FastlaneCore::ConfigItem.new(key: :proxy_port, env_name: "FL_SPLUNKMINT_PROXY_PORT", description: "Proxy port", optional: true) ] end def self.authors ["xfreebird"] end def self.is_supported?(platform) platform == :ios end def self.example_code [ 'splunkmint( dsym: "My.app.dSYM.zip", api_key: "43564d3a", api_token: "e05456234c4869fb7e0b61" )' ] end def self.category :beta end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/verify_pod_keys.rb
fastlane/lib/fastlane/actions/verify_pod_keys.rb
module Fastlane module Actions class VerifyPodKeysAction < Action def self.run(params) UI.message("Validating CocoaPods Keys") options = plugin_options target = options["target"] || "" options["keys"].each do |key| UI.message(" - #{key}") validate(key, target) end end def self.plugin_options require 'cocoapods-core' podfile = Pod::Podfile.from_file("Podfile") podfile.plugins["cocoapods-keys"] end def self.validate(key, target) if value(key, target).length < 2 message = "Did not pass validation for key #{key}. " \ "Run `[bundle exec] pod keys get #{key} #{target}` to see what it is. " \ "It's likely this is running with empty/OSS keys." raise message end end def self.value(key, target) value = `pod keys get #{key} #{target}` value.split("]").last.strip end def self.author "ashfurrow" end ##################################################### # @!group Documentation ##################################################### def self.description "Verifies all keys referenced from the Podfile are non-empty" end def self.details "Runs a check against all keys specified in your Podfile to make sure they're more than a single character long. This is to ensure you don't deploy with stubbed keys." end def self.is_supported?(platform) [:ios, :mac].include?(platform) end def self.example_code [ 'verify_pod_keys' ] end def self.category :building end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false
fastlane/fastlane
https://github.com/fastlane/fastlane/blob/d1f6eb6228644936997aae1956d8036ea62cd5b4/fastlane/lib/fastlane/actions/automatic_code_signing.rb
fastlane/lib/fastlane/actions/automatic_code_signing.rb
require 'xcodeproj' module Fastlane module Actions class AutomaticCodeSigningAction < Action def self.run(params) UI.deprecated("The `automatic_code_signing` action has been deprecated,") UI.deprecated("Please use `update_code_signing_settings` action instead.") FastlaneCore::PrintTable.print_values(config: params, title: "Summary for Automatic Codesigning") path = params[:path] path = File.join(File.expand_path(path), "project.pbxproj") project = Xcodeproj::Project.open(params[:path]) UI.user_error!("Could not find path to project config '#{path}'. Pass the path to your project (not workspace)!") unless File.exist?(path) UI.message("Updating the Automatic Codesigning flag to #{params[:use_automatic_signing] ? 'enabled' : 'disabled'} for the given project '#{path}'") unless project.root_object.attributes["TargetAttributes"] UI.user_error!("Seems to be a very old project file format - please open your project file in a more recent version of Xcode") return false end target_dictionary = project.targets.map { |f| { name: f.name, uuid: f.uuid, build_configuration_list: f.build_configuration_list } } target_attributes = project.root_object.attributes["TargetAttributes"] changed_targets = [] # make sure TargetAttributes exist for all targets target_dictionary.each do |props| unless target_attributes.key?(props[:uuid]) target_attributes[props[:uuid]] = {} end end target_attributes.each do |target, sett| found_target = target_dictionary.detect { |h| h[:uuid] == target } if params[:targets] # get target name unless params[:targets].include?(found_target[:name]) UI.important("Skipping #{found_target[:name]} not selected (#{params[:targets].join(',')})") next end end style_value = params[:use_automatic_signing] ? 'Automatic' : 'Manual' build_configuration_list = found_target[:build_configuration_list] build_configuration_list.set_setting("CODE_SIGN_STYLE", style_value) sett["ProvisioningStyle"] = style_value if params[:team_id] sett["DevelopmentTeam"] = params[:team_id] build_configuration_list.set_setting("DEVELOPMENT_TEAM", params[:team_id]) UI.important("Set Team id to: #{params[:team_id]} for target: #{found_target[:name]}") end if params[:code_sign_identity] build_configuration_list.set_setting("CODE_SIGN_IDENTITY", params[:code_sign_identity]) # We also need to update the value if it was overridden for a specific SDK build_configuration_list.build_configurations.each do |build_configuration| codesign_build_settings_keys = build_configuration.build_settings.keys.select { |key| key.to_s.match(/CODE_SIGN_IDENTITY.*/) } codesign_build_settings_keys.each do |setting| build_configuration_list.set_setting(setting, params[:code_sign_identity]) end end UI.important("Set Code Sign identity to: #{params[:code_sign_identity]} for target: #{found_target[:name]}") end if params[:profile_name] build_configuration_list.set_setting("PROVISIONING_PROFILE_SPECIFIER", params[:profile_name]) UI.important("Set Provisioning Profile name to: #{params[:profile_name]} for target: #{found_target[:name]}") end # Since Xcode 8, this is no longer needed, you simply use PROVISIONING_PROFILE_SPECIFIER if params[:profile_uuid] build_configuration_list.set_setting("PROVISIONING_PROFILE", params[:profile_uuid]) UI.important("Set Provisioning Profile UUID to: #{params[:profile_uuid]} for target: #{found_target[:name]}") end if params[:bundle_identifier] build_configuration_list.set_setting("PRODUCT_BUNDLE_IDENTIFIER", params[:bundle_identifier]) UI.important("Set Bundle identifier to: #{params[:bundle_identifier]} for target: #{found_target[:name]}") end changed_targets << found_target[:name] end project.save if changed_targets.empty? UI.important("None of the specified targets has been modified") UI.important("available targets:") target_dictionary.each do |target| UI.important("\t* #{target[:name]}") end else UI.success("Successfully updated project settings to use Code Sign Style = '#{params[:use_automatic_signing] ? 'Automatic' : 'Manual'}'") UI.success("Modified Targets:") changed_targets.each do |target| UI.success("\t * #{target}") end end params[:use_automatic_signing] end def self.alias_used(action_alias, params) params[:use_automatic_signing] = true if action_alias == "enable_automatic_code_signing" end def self.aliases ["enable_automatic_code_signing", "disable_automatic_code_signing"] end def self.description "Configures Xcode's Codesigning options" end def self.details "Configures Xcode's Codesigning options of all targets in the project" end def self.available_options [ FastlaneCore::ConfigItem.new(key: :path, env_name: "FL_PROJECT_SIGNING_PROJECT_PATH", description: "Path to your Xcode project", code_gen_sensitive: true, default_value: Dir['*.xcodeproj'].first, default_value_dynamic: true, verify_block: proc do |value| UI.user_error!("Path is invalid") unless File.exist?(File.expand_path(value)) end), FastlaneCore::ConfigItem.new(key: :use_automatic_signing, env_name: "FL_PROJECT_USE_AUTOMATIC_SIGNING", description: "Defines if project should use automatic signing", type: Boolean, default_value: false), FastlaneCore::ConfigItem.new(key: :team_id, env_name: "FASTLANE_TEAM_ID", optional: true, description: "Team ID, is used when upgrading project"), FastlaneCore::ConfigItem.new(key: :targets, env_name: "FL_PROJECT_SIGNING_TARGETS", optional: true, type: Array, description: "Specify targets you want to toggle the signing mech. (default to all targets)"), FastlaneCore::ConfigItem.new(key: :code_sign_identity, env_name: "FL_CODE_SIGN_IDENTITY", description: "Code signing identity type (iPhone Developer, iPhone Distribution)", optional: true), FastlaneCore::ConfigItem.new(key: :profile_name, env_name: "FL_PROVISIONING_PROFILE_SPECIFIER", description: "Provisioning profile name to use for code signing", optional: true), FastlaneCore::ConfigItem.new(key: :profile_uuid, env_name: "FL_PROVISIONING_PROFILE", description: "Provisioning profile UUID to use for code signing", optional: true), FastlaneCore::ConfigItem.new(key: :bundle_identifier, env_name: "FL_APP_IDENTIFIER", description: "Application Product Bundle Identifier", optional: true) ] end def self.output end def self.example_code [ '# enable automatic code signing enable_automatic_code_signing', 'enable_automatic_code_signing( path: "demo-project/demo/demo.xcodeproj" )', '# disable automatic code signing disable_automatic_code_signing', 'disable_automatic_code_signing( path: "demo-project/demo/demo.xcodeproj" )', '# also set team id disable_automatic_code_signing( path: "demo-project/demo/demo.xcodeproj", team_id: "XXXX" )', '# Only specific targets disable_automatic_code_signing( path: "demo-project/demo/demo.xcodeproj", use_automatic_signing: false, targets: ["demo"] ) ', ' # via generic action automatic_code_signing( path: "demo-project/demo/demo.xcodeproj", use_automatic_signing: false )', 'automatic_code_signing( path: "demo-project/demo/demo.xcodeproj", use_automatic_signing: true )' ] end def self.category :deprecated end def self.deprecated_notes "Please use `update_code_signing_settings` action instead." end def self.return_value "The current status (boolean) of codesigning after modification" end def self.authors ["mathiasAichinger", "hjanuschka", "p4checo", "portellaa", "aeons"] end def self.is_supported?(platform) [:ios, :mac].include?(platform) end end end end
ruby
MIT
d1f6eb6228644936997aae1956d8036ea62cd5b4
2026-01-04T15:37:27.371479Z
false