fastlane-plugin-sq_ci 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +52 -0
  4. data/lib/fastlane/plugin/sq_ci/actions/sq_ci_add_version_tag_action.rb +51 -0
  5. data/lib/fastlane/plugin/sq_ci/actions/sq_ci_build_ios_application_action.rb +129 -0
  6. data/lib/fastlane/plugin/sq_ci/actions/sq_ci_get_app_version_string_action.rb +74 -0
  7. data/lib/fastlane/plugin/sq_ci/actions/sq_ci_get_bundle_identifier_action.rb +51 -0
  8. data/lib/fastlane/plugin/sq_ci/actions/sq_ci_get_last_version_code_from_google_play_action.rb +59 -0
  9. data/lib/fastlane/plugin/sq_ci/actions/sq_ci_get_team_identifier_action.rb +51 -0
  10. data/lib/fastlane/plugin/sq_ci/actions/sq_ci_notify_action.rb +57 -0
  11. data/lib/fastlane/plugin/sq_ci/actions/sq_ci_prepare_keychain_action.rb +50 -0
  12. data/lib/fastlane/plugin/sq_ci/actions/sq_ci_send_telegram_message_action.rb +64 -0
  13. data/lib/fastlane/plugin/sq_ci/actions/sq_ci_set_version_code_action.rb +48 -0
  14. data/lib/fastlane/plugin/sq_ci/actions/sq_ci_upload_aab_to_google_play_action.rb +69 -0
  15. data/lib/fastlane/plugin/sq_ci/actions/sq_ci_upload_file_to_s3_action.rb +84 -0
  16. data/lib/fastlane/plugin/sq_ci/helper/sq_ci_helper.rb +154 -0
  17. data/lib/fastlane/plugin/sq_ci/version.rb +5 -0
  18. data/lib/fastlane/plugin/sq_ci.rb +14 -0
  19. data/lib/sq_ci/android_app/options.rb +28 -0
  20. data/lib/sq_ci/code_signing/options.rb +43 -0
  21. data/lib/sq_ci/google_play/options.rb +38 -0
  22. data/lib/sq_ci/ios_app/options.rb +64 -0
  23. data/lib/sq_ci/keychain/options.rb +27 -0
  24. data/lib/sq_ci/s3/options.rb +48 -0
  25. data/lib/sq_ci/shared/options.rb +21 -0
  26. data/lib/sq_ci/sq_ci.rb +2 -0
  27. data/lib/sq_ci/telegram/options.rb +35 -0
  28. metadata +69 -0
@@ -0,0 +1,48 @@
1
+ require 'fastlane/action'
2
+ require_relative '../helper/sq_ci_helper'
3
+ require_relative '../../../../sq_ci/android_app/options'
4
+
5
+ module Fastlane
6
+ module Actions
7
+ class SqCiSetVersionCodeAction < Action
8
+ def self.run(params)
9
+ gradle_file_path = Helper::SqCiHelper.get_gradle_file_path(params[:gradle_file_path])
10
+ new_version_code = Helper::SqCiHelper.get_new_version_code(gradle_file_path, params[:version_code])
11
+
12
+ Helper::SqCiHelper.save_key_to_gradle_file(gradle_file_path, "versionCode", new_version_code)
13
+ end
14
+
15
+ def self.description
16
+ 'Set version code for Android application'
17
+ end
18
+
19
+ def self.details
20
+ ''
21
+ end
22
+
23
+ def self.available_options
24
+ [
25
+ FastlaneCore::ConfigItem.new(
26
+ key: :version_code,
27
+ description: 'Version code to set',
28
+ optional: false,
29
+ type: String
30
+ )
31
+ ] +
32
+ ::SqCi::AndroidApp::Options.options
33
+ end
34
+
35
+ def self.return_value
36
+ ''
37
+ end
38
+
39
+ def self.authors
40
+ ['Semen Kologrivov']
41
+ end
42
+
43
+ def self.is_supported?(_)
44
+ true
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,69 @@
1
+ require 'fastlane/action'
2
+ require_relative '../helper/sq_ci_helper'
3
+ require_relative '../../../../sq_ci/google_play/options'
4
+ require_relative '../../../../sq_ci/android_app/options'
5
+ require_relative '../../../../sq_ci/shared/options'
6
+
7
+ module Fastlane
8
+ module Actions
9
+ class SqCiUploadAabToGooglePlayAction < Action
10
+ def self.run(params)
11
+ google_play_client = Supply::Client.make_from_config(
12
+ params: {
13
+ json_key: params[:json_key_file],
14
+ timeout: params[:timeout]
15
+ }
16
+ )
17
+
18
+ Supply.config = params
19
+
20
+ google_play_client.begin_edit(
21
+ package_name: params[:package_name]
22
+ )
23
+
24
+ google_play_client.upload_bundle(
25
+ params[:aab_path]
26
+ )
27
+ google_play_client.commit_current_edit!
28
+ end
29
+
30
+ def self.description
31
+ 'Upload aab file to the Google Play'
32
+ end
33
+
34
+ def self.details
35
+ ''
36
+ end
37
+
38
+ def self.available_options
39
+ [
40
+ FastlaneCore::ConfigItem.new(
41
+ key: :aab_path,
42
+ description: "Path to the aab file",
43
+ optional: false,
44
+ type: String
45
+ )
46
+ ] +
47
+ ::SqCi::GooglePlay::Options.options +
48
+ ::SqCi::AndroidApp::Options.options +
49
+ ::SqCi::Shared::Options.options
50
+ end
51
+
52
+ def self.return_type
53
+ :string
54
+ end
55
+
56
+ def self.return_value
57
+ ''
58
+ end
59
+
60
+ def self.authors
61
+ ['Semen Kologrivov']
62
+ end
63
+
64
+ def self.is_supported?(_)
65
+ true
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,84 @@
1
+ require 'fastlane/action'
2
+ require_relative '../helper/sq_ci_helper'
3
+ require_relative '../../../../sq_ci/s3/options'
4
+ require 'aws-sdk-core'
5
+
6
+ module Fastlane
7
+ module Actions
8
+ class SqCiUploadFileToS3Action < Action
9
+ def self.run(params)
10
+ access_key = params[:s3_access_key_id]
11
+ key_secret = params[:s3_secret_access_key]
12
+ bucket_name = params[:s3_bucket_name]
13
+ region_name = params[:s3_region_name]
14
+ endpoint = params[:s3_endpoint]
15
+
16
+ file_path = params[:file_path]
17
+ filename = File.basename(file_path)
18
+ file_key = [params[:relative_path], filename].compact.reject(&:empty?).join("/")
19
+
20
+ credentials = Aws::Credentials.new(access_key, key_secret)
21
+ s3_client = Aws::S3::Client.new(
22
+ region: region_name,
23
+ credentials: credentials,
24
+ endpoint: endpoint
25
+ )
26
+
27
+ # https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/S3/Client.html#put_object-instance_method
28
+ s3_client.put_object(
29
+ acl: 'public-read',
30
+ body: File.open(file_path),
31
+ bucket: bucket_name,
32
+ key: file_key
33
+ )
34
+
35
+ uploaded_object = Aws::S3::Object.new(bucket_name, file_key, client: s3_client)
36
+ public_url = uploaded_object.public_url
37
+
38
+ return public_url
39
+ end
40
+
41
+ def self.description
42
+ 'Upload file to S3-compatible storage'
43
+ end
44
+
45
+ def self.details
46
+ ''
47
+ end
48
+
49
+ def self.available_options
50
+ [
51
+ FastlaneCore::ConfigItem.new(
52
+ key: :file_path,
53
+ description: 'Path to file for upload',
54
+ optional: false,
55
+ type: String
56
+ ),
57
+ FastlaneCore::ConfigItem.new(
58
+ key: :relative_path,
59
+ description: 'Relative path to file on s3 storage',
60
+ optional: true,
61
+ type: String
62
+ )
63
+ ] +
64
+ ::SqCi::S3::Options.options
65
+ end
66
+
67
+ def self.return_type
68
+ :string
69
+ end
70
+
71
+ def self.return_value
72
+ 'Link for uploaded file'
73
+ end
74
+
75
+ def self.authors
76
+ ['Semen Kologrivov']
77
+ end
78
+
79
+ def self.is_supported?(_)
80
+ true
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,154 @@
1
+ require 'fastlane/action'
2
+ require 'fastlane_core/ui/ui'
3
+
4
+ require 'xcodeproj'
5
+ require "shellwords"
6
+ require "tempfile"
7
+ require "fileutils"
8
+
9
+ module Fastlane
10
+ UI = FastlaneCore::UI unless Fastlane.const_defined?(:UI)
11
+
12
+ module Helper
13
+ class SqCiHelper
14
+ GRADLE_FILE_TEST = "/tmp/fastlane/tests/versioning/app/build.gradle"
15
+
16
+ def self.notification_message(app_name:, app_version_string:, app_type:, links:)
17
+ if app_type == "beta"
18
+ message = "Коллеги, сборка приложения '#{app_name}' #{app_version_string} готова к тестированию!"
19
+ elsif app_type == "rc"
20
+ message = "Коллеги, предрелизная сборка приложения '#{app_name}' #{app_version_string} готова к тестированию!"
21
+ elsif app_type == "release"
22
+ message = "Коллеги, сборка приложения '#{app_name}' #{app_version_string} отправлена на ревью!"
23
+ else
24
+ return ""
25
+ end
26
+
27
+ return message if links.nil? || links.length == 0
28
+
29
+ links_message = links
30
+ .select { |link| !link[:url].nil? }
31
+ .map { |link| "#{link[:name] || 'Ссылка на установку'}: #{link[:url]}" }
32
+ .join("\n\n")
33
+
34
+ "#{message}\n\n#{links_message}"
35
+ end
36
+
37
+ def self.add_target_attributes(target_name:, project_path:)
38
+ project = Xcodeproj::Project.open(project_path)
39
+
40
+ project.targets.each do |target|
41
+ next unless target.name == target_name
42
+
43
+ next unless project.root_object.attributes['TargetAttributes'].nil?
44
+
45
+ project.root_object.attributes['TargetAttributes'] = {}
46
+ target_attributes = project.root_object.attributes['TargetAttributes']
47
+ target_attributes[target.uuid] = { "CreatedOnToolsVersion" => "9.4.1" }
48
+ end
49
+
50
+ project.save
51
+ end
52
+
53
+ def self.get_gradle_file(gradle_file)
54
+ return Helper.test? ? GRADLE_FILE_TEST : gradle_file
55
+ end
56
+
57
+ def self.get_gradle_file_path(gradle_file)
58
+ gradle_file = self.get_gradle_file(gradle_file)
59
+ return File.expand_path(gradle_file)
60
+ end
61
+
62
+ def self.get_new_version_code(gradle_file, new_version_code)
63
+ if new_version_code.nil?
64
+ current_version_code = self.read_key_from_gradle_file(gradle_file, "versionCode")
65
+ new_version_code = current_version_code.to_i + 1
66
+ end
67
+
68
+ return new_version_code.to_i
69
+ end
70
+
71
+ def self.get_new_version_name(gradle_file, new_version_name, bump_type = nil)
72
+ if new_version_name.nil?
73
+ new_version_name = self.read_key_from_gradle_file(gradle_file, "versionName")
74
+ end
75
+
76
+ current_version_parts = new_version_name.split(/[.]/)
77
+ major = current_version_parts[0].to_i
78
+ minor = current_version_parts[1].to_i
79
+ patch = current_version_parts[2].to_i
80
+
81
+ if bump_type == "major"
82
+ new_version_name = "#{major + 1}.0.0"
83
+ elsif bump_type == "minor"
84
+ new_version_name = "#{major}.#{minor + 1}.0"
85
+ elsif bump_type == "patch"
86
+ new_version_name = "#{major}.#{minor}.#{patch + 1}"
87
+ end
88
+
89
+ return new_version_name.to_s
90
+ end
91
+
92
+ def self.read_key_from_gradle_file(gradle_file, key)
93
+ value = false
94
+ begin
95
+ file = File.new(gradle_file, "r")
96
+ while (line = file.gets)
97
+ next unless line.include?(key)
98
+
99
+ components = line.strip.split(' ')
100
+ value = components[components.length - 1].tr("\"", "")
101
+ break
102
+ end
103
+ file.close
104
+ rescue StandardError => e
105
+ UI.error("An exception occured while reading gradle file: #{e}")
106
+ e
107
+ end
108
+ return value
109
+ end
110
+
111
+ def self.save_key_to_gradle_file(gradle_file, key, value)
112
+ current_value = self.read_key_from_gradle_file(gradle_file, key)
113
+
114
+ begin
115
+ found = false
116
+ temp_file = Tempfile.new("flSave_#{key}_ToGradleFile")
117
+ File.open(gradle_file, "r") do |file|
118
+ file.each_line do |line|
119
+ if line.include?(key) and found == false
120
+ found = true
121
+ line.replace(line.sub(current_value.to_s, value.to_s))
122
+ end
123
+ temp_file.puts(line)
124
+ end
125
+ file.close
126
+ end
127
+ temp_file.rewind
128
+ temp_file.close
129
+ FileUtils.mv(temp_file.path, gradle_file)
130
+ temp_file.unlink
131
+ end
132
+
133
+ return found == true ? value : -1
134
+ end
135
+
136
+ def self.get_xcodeproj_build_config(xcodeproj_path, main_target, target_scheme)
137
+ project = Xcodeproj::Project.open(xcodeproj_path)
138
+ target = project.native_targets.find { |native_target| native_target.name == main_target }
139
+ target.build_configurations.find { |configuration| configuration.name == target_scheme }
140
+ end
141
+
142
+ def self.get_xcodeproj_targets(xcodeproj_path, target_scheme)
143
+ project = Xcodeproj::Project.open(xcodeproj_path)
144
+ targets = {}
145
+ project.native_targets.each do |native_target|
146
+ build_configuration = native_target.build_configurations.find { |configuration| configuration.name == target_scheme }
147
+ targets[native_target.name] = build_configuration.build_settings['PRODUCT_BUNDLE_IDENTIFIER']
148
+ end
149
+
150
+ targets
151
+ end
152
+ end
153
+ end
154
+ end
@@ -0,0 +1,5 @@
1
+ module Fastlane
2
+ module SqCi
3
+ VERSION = "0.5.0"
4
+ end
5
+ end
@@ -0,0 +1,14 @@
1
+ module Fastlane
2
+ module SqCi
3
+ # Return all .rb files inside the "actions" and "helper" directory
4
+ def self.all_classes
5
+ Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
6
+ end
7
+ end
8
+ end
9
+
10
+ # By default we want to import all available actions and helpers
11
+ # A plugin can contain any number of actions and plugins
12
+ Fastlane::SqCi.all_classes.each do |current|
13
+ require current
14
+ end
@@ -0,0 +1,28 @@
1
+ require 'fastlane_core/configuration/config_item'
2
+ require 'credentials_manager/appfile_config'
3
+
4
+ module SqCi
5
+ module AndroidApp
6
+ class Options
7
+ def self.options
8
+ [
9
+ FastlaneCore::ConfigItem.new(
10
+ key: :package_name,
11
+ env_name: "SQ_CI_PACKAGE_NAME",
12
+ description: "The package name of the Android application to use",
13
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:package_name),
14
+ default_value_dynamic: true
15
+ ),
16
+ FastlaneCore::ConfigItem.new(
17
+ key: :gradle_file_path,
18
+ env_name: 'SQ_CI_GRADLE_FILE_PATH',
19
+ description: 'Path to build.gradle file',
20
+ default_value: "app/build.gradle",
21
+ optional: true,
22
+ type: String
23
+ )
24
+ ]
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,43 @@
1
+ require 'fastlane_core/configuration/config_item'
2
+ require 'credentials_manager/appfile_config'
3
+
4
+ module SqCi
5
+ module CodeSigning
6
+ class Options
7
+ def self.options
8
+ [
9
+ FastlaneCore::ConfigItem.new(
10
+ key: :code_signing_type,
11
+ env_name: 'SQ_CI_CODE_SIGNING_TYPE',
12
+ description: 'Targets in project',
13
+ optional: true,
14
+ type: String,
15
+ default_value: 'appstore'
16
+ ),
17
+ FastlaneCore::ConfigItem.new(
18
+ key: :code_sign_identity,
19
+ env_name: 'SQ_CI_CODE_SIGN_IDENTITY',
20
+ description: 'Code sign identity for profile',
21
+ optional: true,
22
+ type: String,
23
+ default_value: 'iPhone Distribution'
24
+ ),
25
+ FastlaneCore::ConfigItem.new(
26
+ key: :certificates_repo,
27
+ env_name: 'SQ_CI_CERTIFICATES_REPO',
28
+ description: 'Repository for store certificates and profiles',
29
+ optional: false,
30
+ type: String
31
+ ),
32
+ FastlaneCore::ConfigItem.new(
33
+ key: :certificates_password,
34
+ env_name: 'SQ_CI_CERTIFICATES_PASSWORD',
35
+ description: 'Password for certificates and profiles storage',
36
+ optional: false,
37
+ type: String
38
+ )
39
+ ]
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,38 @@
1
+ require 'fastlane_core/configuration/config_item'
2
+ require 'credentials_manager/appfile_config'
3
+
4
+ module SqCi
5
+ module GooglePlay
6
+ class Options
7
+ def self.options
8
+ [
9
+ FastlaneCore::ConfigItem.new(
10
+ key: :json_key_file,
11
+ env_name: "SQ_CI_JSON_KEY_FILE",
12
+ optional: true,
13
+ description: "The path to a file containing service account JSON, used to authenticate with Google",
14
+ default_value: CredentialsManager::AppfileConfig.try_fetch_value(:json_key_file),
15
+ default_value_dynamic: true,
16
+ verify_block: proc do |value|
17
+ UI.user_error!("Could not find service account json file at path '#{File.expand_path(value)}'") unless File.exist?(File.expand_path(value))
18
+ UI.user_error!("'#{value}' doesn't seem to be a JSON file") unless FastlaneCore::Helper.json_file?(File.expand_path(value))
19
+ end
20
+ ),
21
+ FastlaneCore::ConfigItem.new(
22
+ key: :changes_not_sent_for_review,
23
+ env_name: "SQ_CI_CHANGES_NOT_SENT_FOR_REVIEW",
24
+ description: "Indicates that the changes in this edit will not be reviewed until they are explicitly sent for review from the Google Play Console UI",
25
+ default_value: false
26
+ ),
27
+ FastlaneCore::ConfigItem.new(
28
+ key: :ack_bundle_installation_warning,
29
+ env_name: "ACK_BUNDLE_INSTALLATION_WARNING",
30
+ description: "Must be set to true if the bundle installation may trigger a warning on user devices (e.g can only be downloaded over wifi). Typically this is required for bundles over 150MB",
31
+ optional: true,
32
+ default_value: false
33
+ )
34
+ ]
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,64 @@
1
+ require 'fastlane_core/configuration/config_item'
2
+ require 'credentials_manager/appfile_config'
3
+
4
+ module SqCi
5
+ module IosApp
6
+ class Options
7
+ def self.options
8
+ [
9
+ FastlaneCore::ConfigItem.new(
10
+ key: :project_path,
11
+ env_name: 'SQ_CI_PROJECT_PATH',
12
+ description: 'Path to project',
13
+ optional: true,
14
+ type: String
15
+ ),
16
+ FastlaneCore::ConfigItem.new(
17
+ key: :workspace_path,
18
+ env_name: 'SQ_CI_WORKSPACE_PATH',
19
+ description: 'Path to workspace',
20
+ optional: true,
21
+ type: String
22
+ ),
23
+ FastlaneCore::ConfigItem.new(
24
+ key: :main_target,
25
+ description: 'Name of main target',
26
+ env_name: 'SQ_CI_MAIN_TARGET',
27
+ optional: true,
28
+ type: String
29
+ ),
30
+ FastlaneCore::ConfigItem.new(
31
+ key: :export_method,
32
+ env_name: 'SQ_CI_EXPORT_METHOD',
33
+ description: 'Export method for build',
34
+ optional: true,
35
+ type: String,
36
+ default_value: "app-store"
37
+ ),
38
+ FastlaneCore::ConfigItem.new(
39
+ key: :build_args,
40
+ env_name: 'SQ_CI_BUILD_ARGS',
41
+ description: 'Additional args for project build',
42
+ optional: true,
43
+ type: String,
44
+ default_value: "-skipPackagePluginValidation -skipMacroValidation -allowProvisioningUpdates"
45
+ ),
46
+ FastlaneCore::ConfigItem.new(
47
+ key: :should_clear_project,
48
+ env_name: 'SQ_CI_SHOULD_CLEAR_PROJECT',
49
+ description: 'Should clear project before build',
50
+ optional: true,
51
+ default_value: true
52
+ ),
53
+ FastlaneCore::ConfigItem.new(
54
+ key: :derived_data_path,
55
+ env_name: 'SQ_CI_DERIVED_DATA_PATH',
56
+ description: 'Path to derived data folder',
57
+ optional: true,
58
+ type: String
59
+ )
60
+ ]
61
+ end
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,27 @@
1
+ require 'fastlane_core/configuration/config_item'
2
+ require 'credentials_manager/appfile_config'
3
+
4
+ module SqCi
5
+ module Keychain
6
+ class Options
7
+ def self.options
8
+ [
9
+ FastlaneCore::ConfigItem.new(
10
+ key: :keychain_name,
11
+ env_name: 'SQ_CI_KEYCHAIN_NAME',
12
+ description: 'Keychain name for storing certificates',
13
+ optional: false,
14
+ type: String
15
+ ),
16
+ FastlaneCore::ConfigItem.new(
17
+ key: :keychain_password,
18
+ env_name: 'SQ_CI_KEYCHAIN_PASSWORD',
19
+ description: 'Password for keychain for storing certificates',
20
+ optional: false,
21
+ type: String
22
+ )
23
+ ]
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,48 @@
1
+ require 'fastlane_core/configuration/config_item'
2
+ require 'credentials_manager/appfile_config'
3
+
4
+ module SqCi
5
+ module S3
6
+ class Options
7
+ def self.options
8
+ [
9
+ FastlaneCore::ConfigItem.new(
10
+ key: :s3_access_key_id,
11
+ env_name: 'SQ_CI_S3_ACCESS_KEY_ID',
12
+ description: 'Identifier for S3 access key',
13
+ optional: false,
14
+ type: String
15
+ ),
16
+ FastlaneCore::ConfigItem.new(
17
+ key: :s3_secret_access_key,
18
+ env_name: 'SQ_CI_S3_SECRET_ACCESS_KEY',
19
+ description: 'Secret for S3 access key',
20
+ optional: false,
21
+ type: String
22
+ ),
23
+ FastlaneCore::ConfigItem.new(
24
+ key: :s3_region_name,
25
+ env_name: 'SQ_CI_S3_REGION_NAME',
26
+ description: 'Region name of S3 storage',
27
+ optional: false,
28
+ type: String
29
+ ),
30
+ FastlaneCore::ConfigItem.new(
31
+ key: :s3_bucket_name,
32
+ env_name: 'SQ_CI_S3_BUCKET_NAME',
33
+ description: 'S3\'s bucket name',
34
+ optional: false,
35
+ type: String
36
+ ),
37
+ FastlaneCore::ConfigItem.new(
38
+ key: :s3_endpoint,
39
+ env_name: 'SQ_CI_S3_ENDPOINT',
40
+ description: 'Endpoint for S3 storage',
41
+ optional: false,
42
+ type: String
43
+ )
44
+ ]
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,21 @@
1
+ require 'fastlane_core/configuration/config_item'
2
+ require 'credentials_manager/appfile_config'
3
+
4
+ module SqCi
5
+ module Shared
6
+ class Options
7
+ def self.options
8
+ [
9
+ FastlaneCore::ConfigItem.new(
10
+ key: :timeout,
11
+ env_name: "SQ_CI_TIMEOUT",
12
+ optional: true,
13
+ description: "Timeout for read, open, and send (in seconds)",
14
+ type: Integer,
15
+ default_value: 300
16
+ )
17
+ ]
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,2 @@
1
+ module SqCi
2
+ end
@@ -0,0 +1,35 @@
1
+ require 'fastlane_core/configuration/config_item'
2
+ require 'credentials_manager/appfile_config'
3
+
4
+ module SqCi
5
+ module Telegram
6
+ class Options
7
+ def self.options
8
+ [
9
+ FastlaneCore::ConfigItem.new(
10
+ key: :telegram_access_token,
11
+ env_name: 'SQ_CI_TELEGRAM_ACCESS_TOKEN',
12
+ description: 'Access token for Telegram bot',
13
+ optional: true,
14
+ type: String
15
+ ),
16
+ FastlaneCore::ConfigItem.new(
17
+ key: :telegram_chat_ids,
18
+ env_name: 'SQ_CI_TELEGRAM_CHAT_IDS',
19
+ description: 'Telegram\'s chat ids for send message',
20
+ optional: true,
21
+ type: String
22
+ ),
23
+ FastlaneCore::ConfigItem.new(
24
+ key: :parse_mode,
25
+ env_name: 'SQ_CI_TELEGRAM_PARSE_MODE',
26
+ description: 'Telegram\'s parse mode',
27
+ optional: true,
28
+ type: String,
29
+ default_value: "Markdown"
30
+ )
31
+ ]
32
+ end
33
+ end
34
+ end
35
+ end