fastlane-plugin-yalantis_ci 0.1.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.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +52 -0
- data/lib/fastlane/plugin/yalantis_ci.rb +16 -0
- data/lib/fastlane/plugin/yalantis_ci/actions/ci_setup.rb +162 -0
- data/lib/fastlane/plugin/yalantis_ci/actions/ci_teardown.rb +22 -0
- data/lib/fastlane/plugin/yalantis_ci/actions/firebase_distribution_setup.rb +185 -0
- data/lib/fastlane/plugin/yalantis_ci/actions/install_brew_dependencies.rb +18 -0
- data/lib/fastlane/plugin/yalantis_ci/actions/yalantis_ci_action.rb +47 -0
- data/lib/fastlane/plugin/yalantis_ci/helper/yalantis_ci_helper.rb +16 -0
- data/lib/fastlane/plugin/yalantis_ci/version.rb +5 -0
- metadata +192 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c70f6ba1538fb0b9297ac219fff7639474a43429b64ae6cdf4ef987e56db4674
|
4
|
+
data.tar.gz: ef74af7babdddbf544b0cf0e34eeb24b57db4d00fb81ad1895a377e15182a3ab
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3717b6937625d894a5b21fd874f22546ff4a75d1bb036c073e9a1e530e11d32034a3d517f48eadf610c29fc10af0649c9bc00b8e69ae9b976511b6c24a519c01
|
7
|
+
data.tar.gz: 188d0daa30d5c5a90cb281513c6201a26d8e0486a92dd7f708b76958698e9c4c414df8f6693fb833cf99b842625be8f59e500a912a5bc80e3c74b2ff278179c0
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2021 Dima Vorona <dmytro.vorona@yalantis.net>
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# yalantis_ci plugin
|
2
|
+
|
3
|
+
[](https://rubygems.org/gems/fastlane-plugin-yalantis_ci)
|
4
|
+
|
5
|
+
## Getting Started
|
6
|
+
|
7
|
+
This project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-yalantis_ci`, add it to your project by running:
|
8
|
+
|
9
|
+
```bash
|
10
|
+
fastlane add_plugin yalantis_ci
|
11
|
+
```
|
12
|
+
|
13
|
+
## About yalantis_ci
|
14
|
+
|
15
|
+
Set of utilities and useful actions to help setup CI for Yalantis projects
|
16
|
+
|
17
|
+
**Note to author:** Add a more detailed description about this plugin here. If your plugin contains multiple actions, make sure to mention them here.
|
18
|
+
|
19
|
+
## Example
|
20
|
+
|
21
|
+
Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.
|
22
|
+
|
23
|
+
**Note to author:** Please set up a sample project to make it easy for users to explore what your plugin does. Provide everything that is necessary to try out the plugin in this project (including a sample Xcode/Android project if necessary)
|
24
|
+
|
25
|
+
## Run tests for this plugin
|
26
|
+
|
27
|
+
To run both the tests, and code style validation, run
|
28
|
+
|
29
|
+
```
|
30
|
+
rake
|
31
|
+
```
|
32
|
+
|
33
|
+
To automatically fix many of the styling issues, use
|
34
|
+
```
|
35
|
+
rubocop -a
|
36
|
+
```
|
37
|
+
|
38
|
+
## Issues and Feedback
|
39
|
+
|
40
|
+
For any other issues and feedback about this plugin, please submit it to this repository.
|
41
|
+
|
42
|
+
## Troubleshooting
|
43
|
+
|
44
|
+
If you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.
|
45
|
+
|
46
|
+
## Using _fastlane_ Plugins
|
47
|
+
|
48
|
+
For more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).
|
49
|
+
|
50
|
+
## About _fastlane_
|
51
|
+
|
52
|
+
_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane/plugin/yalantis_ci/version'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module YalantisCi
|
5
|
+
# Return all .rb files inside the "actions" and "helper" directory
|
6
|
+
def self.all_classes
|
7
|
+
Dir[File.expand_path('**/{actions,helper}/*.rb', File.dirname(__FILE__))]
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# By default we want to import all available actions and helpers
|
13
|
+
# A plugin can contain any number of actions and plugins
|
14
|
+
Fastlane::YalantisCi.all_classes.each do |current|
|
15
|
+
require current
|
16
|
+
end
|
@@ -0,0 +1,162 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
CI_UNIQUE_PROJECT_ID = :CI_UNIQUE_PROJECT_ID
|
5
|
+
end
|
6
|
+
|
7
|
+
class CiSetupAction < Action
|
8
|
+
def self.run(params)
|
9
|
+
# Print table
|
10
|
+
FastlaneCore::PrintTable.print_values(
|
11
|
+
config: params,
|
12
|
+
title: "Summary for CI Setup Action"
|
13
|
+
)
|
14
|
+
|
15
|
+
id = self.unique_id(params[:project])
|
16
|
+
UI.message("Setting CI_UNIQUE_PROJECT_ID to: \"#{id}\"")
|
17
|
+
Actions.lane_context[SharedValues::CI_UNIQUE_PROJECT_ID] = id
|
18
|
+
ENV['CI_UNIQUE_PROJECT_ID'] = id
|
19
|
+
|
20
|
+
# We want to setup match repo regardless of the environment.
|
21
|
+
# On both local and remote machine this should be set to the same value
|
22
|
+
self.setup_match_repo(id)
|
23
|
+
|
24
|
+
if !Helper.ci?
|
25
|
+
return
|
26
|
+
end
|
27
|
+
|
28
|
+
self.setup_temp_keychain(id)
|
29
|
+
|
30
|
+
# Set output directory
|
31
|
+
if params[:output_directory]
|
32
|
+
output_directory_path = File.expand_path(params[:output_directory])
|
33
|
+
UI.message("Setting output directory path to: \"#{output_directory_path}\".")
|
34
|
+
ENV['GYM_BUILD_PATH'] = output_directory_path
|
35
|
+
ENV['GYM_OUTPUT_DIRECTORY'] = output_directory_path
|
36
|
+
ENV['SCAN_OUTPUT_DIRECTORY'] = output_directory_path
|
37
|
+
ENV['BACKUP_XCARCHIVE_DESTINATION'] = output_directory_path
|
38
|
+
|
39
|
+
if params[:archive_name]
|
40
|
+
extension = "xcarchive"
|
41
|
+
archive_name = File.basename(params[:archive_name], File.extname(params[:archive_name])) + extension
|
42
|
+
archive_path = File.join(output_directory_path, params[:archive_name])
|
43
|
+
|
44
|
+
UI.message("Setting archive path to: \"#{output_directory_path}\".")
|
45
|
+
ENV['GYM_ARCHIVE_PATH'] = archive_path
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
# Set derived data
|
50
|
+
if params[:derived_data_path]
|
51
|
+
derived_data_path = File.expand_path(params[:derived_data_path])
|
52
|
+
UI.message("Setting derived data path to: \"#{derived_data_path}\".")
|
53
|
+
ENV['DERIVED_DATA_PATH'] = derived_data_path # Used by clear_derived_data.
|
54
|
+
ENV['XCODE_DERIVED_DATA_PATH'] = derived_data_path
|
55
|
+
ENV['GYM_DERIVED_DATA_PATH'] = derived_data_path
|
56
|
+
ENV['SCAN_DERIVED_DATA_PATH'] = derived_data_path
|
57
|
+
ENV['FL_CARTHAGE_DERIVED_DATA'] = derived_data_path
|
58
|
+
ENV['FL_SLATHER_BUILD_DIRECTORY'] = derived_data_path
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def self.unique_id(project)
|
63
|
+
# Ensure that MATCH_GIT_BRANCH is set to a unique name to not commit to the master.
|
64
|
+
normalized_xcodeproj = File.basename(project, File.extname(project)).gsub(/[^0-9a-z]/i, '-').downcase
|
65
|
+
team_id = CredentialsManager::AppfileConfig.try_fetch_value(:team_id) || ENV['FASTLANE_TEAM_ID']
|
66
|
+
|
67
|
+
team_id.empty? ? normalized_xcodeproj : "#{normalized_xcodeproj}-#{team_id}"
|
68
|
+
end
|
69
|
+
|
70
|
+
def self.setup_match_repo(branch_name)
|
71
|
+
# We need to setup a unique name for Match Repo to not interfere with any other
|
72
|
+
# project. Project name includes normalized xcodeproj name and team id.
|
73
|
+
# This ensures that same project can use different teams simultaniously.
|
74
|
+
UI.message("Setting Match repo branch to: \"#{branch_name}\"")
|
75
|
+
ENV['MATCH_GIT_BRANCH'] = branch_name
|
76
|
+
end
|
77
|
+
|
78
|
+
def self.setup_temp_keychain(id)
|
79
|
+
name = "#{id}-fastlane"
|
80
|
+
password = "#{name}-password"
|
81
|
+
path = File.expand_path("~/Library/Keychains/#{name}.keychain-db")
|
82
|
+
|
83
|
+
ENV['KEYCHAIN_PASSWORD'] = password
|
84
|
+
ENV['KEYCHAIN_PATH'] = path
|
85
|
+
ENV['MATCH_KEYCHAIN_NAME'] = name
|
86
|
+
ENV['MATCH_KEYCHAIN_PASSWORD'] = password
|
87
|
+
|
88
|
+
# In case job has been cancelled, Fastlane's hooks don't get invoked.
|
89
|
+
# It may lead to a keychain creation failures. Therefore we need to wipe-out
|
90
|
+
# previous keychain (if exists).
|
91
|
+
if File.exist?(ENV['KEYCHAIN_PATH'])
|
92
|
+
UI.message("Removing dangling temporary keychain at: \"#{ENV['KEYCHAIN_PATH']}\"")
|
93
|
+
other_action.delete_keychain
|
94
|
+
end
|
95
|
+
|
96
|
+
UI.message("Setting temporary keychain path to: \"#{path}\"")
|
97
|
+
other_action.create_keychain(unlock: true, timeout: false, add_to_search_list: true)
|
98
|
+
end
|
99
|
+
|
100
|
+
#####################################################
|
101
|
+
# @!group Documentation
|
102
|
+
#####################################################
|
103
|
+
|
104
|
+
def self.description
|
105
|
+
"Setup Yalantis-specific settings for CI"
|
106
|
+
end
|
107
|
+
|
108
|
+
def self.details
|
109
|
+
# Optional:
|
110
|
+
# this is your chance to provide a more detailed description of this action
|
111
|
+
"CI Setup action setups CI-specific variables such as build path, derived data path, etc"
|
112
|
+
end
|
113
|
+
|
114
|
+
def self.available_options
|
115
|
+
# Define all options your action supports.
|
116
|
+
|
117
|
+
# Below a few examples
|
118
|
+
[
|
119
|
+
FastlaneCore::ConfigItem.new(key: :derived_data_path,
|
120
|
+
env_name: "CI_DERIVED_DATA_PATH",
|
121
|
+
description: "Path to the derived data to be used",
|
122
|
+
is_string: true,
|
123
|
+
default_value: "./build/DerivedData"
|
124
|
+
),
|
125
|
+
FastlaneCore::ConfigItem.new(key: :output_directory,
|
126
|
+
env_name: "CI_OUTPUT_DIRECTORY",
|
127
|
+
description: "The directory in which the ipa file should be stored in as well as .xcarchive",
|
128
|
+
is_string: true,
|
129
|
+
default_value: "./build"
|
130
|
+
),
|
131
|
+
FastlaneCore::ConfigItem.new(key: :archive_name,
|
132
|
+
env_name: "CI_ARCHIVE_NAME",
|
133
|
+
description: "The name of the .xcarchive to be used. Valid only when :output_directory is passed",
|
134
|
+
is_string: true,
|
135
|
+
optional: true
|
136
|
+
),
|
137
|
+
FastlaneCore::ConfigItem.new(key: :project,
|
138
|
+
env_name: "XC_PROJECT",
|
139
|
+
description: "Path to the .xcodeproj to be used or any project-related description. Used during CI_UNIQUE_PROJECT_ID generation",
|
140
|
+
is_string: true,
|
141
|
+
optional: false
|
142
|
+
),
|
143
|
+
|
144
|
+
]
|
145
|
+
end
|
146
|
+
|
147
|
+
def self.output
|
148
|
+
[
|
149
|
+
['CI_UNIQUE_PROJECT_ID', 'A unique project id being used for the match branch name, keychain name, etc']
|
150
|
+
]
|
151
|
+
end
|
152
|
+
|
153
|
+
def self.authors
|
154
|
+
["Dima Vorona", "Yalantis"]
|
155
|
+
end
|
156
|
+
|
157
|
+
def self.is_supported?(platform)
|
158
|
+
[:ios, :mac].include?(platform)
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class CiTeardownAction < Action
|
4
|
+
def self.run(params)
|
5
|
+
if !Helper.ci?
|
6
|
+
UI.important("Not executed by Continuous Integration system")
|
7
|
+
return
|
8
|
+
end
|
9
|
+
|
10
|
+
other_action.delete_keychain if File.exist?(ENV['KEYCHAIN_PATH'])
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.authors
|
14
|
+
["Dima Vorona", "Yalantis"]
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.is_supported?(platform)
|
18
|
+
[:ios, :mac].include?(platform)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,185 @@
|
|
1
|
+
require 'shellwords'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
module Actions
|
5
|
+
module SharedValues
|
6
|
+
FIREBASE_DISTRIBUTION_RELEASES_URL = :FIREBASE_DISTRIBUTION_RELEASES_URL
|
7
|
+
end
|
8
|
+
|
9
|
+
class FirebaseDistributionSetupAction < Action
|
10
|
+
GOOGLE_APPLICATION_CREDENTIALS = 'GOOGLE_APPLICATION_CREDENTIALS'
|
11
|
+
|
12
|
+
def self.run(params)
|
13
|
+
# Print table
|
14
|
+
FastlaneCore::PrintTable.print_values(
|
15
|
+
config: params,
|
16
|
+
title: "Summary for Firebase Distribution Setup"
|
17
|
+
)
|
18
|
+
|
19
|
+
cmd = ['xcodebuild', '-showBuildSettings']
|
20
|
+
|
21
|
+
workspace = params[:workspace]
|
22
|
+
project = params[:project] || ENV['XC_PROJECT']
|
23
|
+
|
24
|
+
if !workspace.nil? && !workspace.empty? then
|
25
|
+
cmd << "-workspace #{Shellwords.escape(workspace)}" unless workspace.nil? || workspace.empty?
|
26
|
+
elsif !project.nil? && !project.empty?
|
27
|
+
cmd << "-project #{Shellwords.escape(params[:project])}"
|
28
|
+
else
|
29
|
+
UI.error("Both :workspace <#{workspace}> and :project <#{project}> are either empty or not provided. You need to pass at least one of them")
|
30
|
+
return
|
31
|
+
end
|
32
|
+
|
33
|
+
cmd << "-scheme #{Shellwords.escape(params[:scheme])}"
|
34
|
+
|
35
|
+
configuration = params[:configuration]
|
36
|
+
cmd << "-configuration #{Shellwords.escape(configuration)}" unless configuration.nil? || configuration.empty?
|
37
|
+
|
38
|
+
prepared_cmd = cmd.compact.join(" ")
|
39
|
+
build_settings = `#{prepared_cmd}`
|
40
|
+
|
41
|
+
if build_settings.nil? || build_settings.empty? then
|
42
|
+
UI.error("Failed to get Xcode Build Settings after runnning:\n\"#{prepared_cmd}\"")
|
43
|
+
return
|
44
|
+
end
|
45
|
+
|
46
|
+
product_name = build_settings.match(/\b(PRODUCT_NAME\s=\s)(?<value>[\w\d\-\_ ]+)/)[:value]
|
47
|
+
if product_name.nil? then
|
48
|
+
UI.error("Failed to get a Product Name")
|
49
|
+
return
|
50
|
+
end
|
51
|
+
|
52
|
+
info_plist_path = File.join(
|
53
|
+
params[:xcodebuild_archive] || Actions.lane_context[Actions::SharedValues::XCODEBUILD_ARCHIVE],
|
54
|
+
'Products',
|
55
|
+
'Applications',
|
56
|
+
"#{product_name}.app",
|
57
|
+
'GoogleService-Info.plist'
|
58
|
+
)
|
59
|
+
|
60
|
+
if !File.exist?(info_plist_path) then
|
61
|
+
UI.error("No GoogleService-Info.plist has been found in the Project at \"#{info_plist_path}\" Make sure you've added it to the product \"#{product_name}\"")
|
62
|
+
return
|
63
|
+
end
|
64
|
+
|
65
|
+
firebase_project_id = self.read_plist_value(info_plist_path, 'PROJECT_ID')
|
66
|
+
firebase_app_id = self.read_plist_value(info_plist_path, 'GOOGLE_APP_ID')
|
67
|
+
bundle_id = self.read_plist_value(info_plist_path, 'BUNDLE_ID')
|
68
|
+
|
69
|
+
UI.message("Firebase Vars: PROJECT_ID = \"#{firebase_project_id}\"; GOOGLE_APP_ID = \"#{firebase_app_id}\"")
|
70
|
+
UI.message("Setting FIREBASEAPPDISTRO_APP to \"#{firebase_app_id}\"")
|
71
|
+
ENV['FIREBASEAPPDISTRO_APP'] = firebase_app_id
|
72
|
+
|
73
|
+
url = "https://console.firebase.google.com/u/0/project/#{firebase_project_id}/appdistribution/app/ios:#{bundle_id}/releases"
|
74
|
+
UI.message("Setting FIREBASE_DISTRIBUTION_RELEASES_URL to \"#{url}\"")
|
75
|
+
Actions.lane_context[SharedValues::FIREBASE_DISTRIBUTION_RELEASES_URL] = url
|
76
|
+
|
77
|
+
google_app_credentials = params[:google_application_credentials]
|
78
|
+
if !google_app_credentials.nil? && !google_app_credentials.empty? then
|
79
|
+
if File.exist?(google_app_credentials) then
|
80
|
+
UI.message("#{GOOGLE_APPLICATION_CREDENTIALS} has been set to \"#{google_app_credentials}\"")
|
81
|
+
ENV[GOOGLE_APPLICATION_CREDENTIALS] = google_app_credentials
|
82
|
+
else
|
83
|
+
UI.error("google_application_credentials has been set to \"#{google_app_credentials}\" but no file found at the given path")
|
84
|
+
end
|
85
|
+
return
|
86
|
+
end
|
87
|
+
|
88
|
+
google_application_credentials_dir = params[:google_application_credentials_dir]
|
89
|
+
credentials_path = File.join(Dir.pwd, google_application_credentials_dir, "#{firebase_project_id}.json")
|
90
|
+
|
91
|
+
if !File.exist?(credentials_path) then
|
92
|
+
UI.error("No Google Application Credentials has been found at \"#{credentials_path}\". Make sure that either have set either :google_application_credentials or :firebase_setup_keys_dir. On a CI Runner ensure that GOOGLE_APPLICATION_CREDENTIALS has been set")
|
93
|
+
return
|
94
|
+
end
|
95
|
+
|
96
|
+
UI.message("Setting \"#{GOOGLE_APPLICATION_CREDENTIALS}\" to \"#{credentials_path}\"")
|
97
|
+
ENV[GOOGLE_APPLICATION_CREDENTIALS] = credentials_path
|
98
|
+
end
|
99
|
+
|
100
|
+
def self.read_plist_value(info_plist_path, key)
|
101
|
+
expr = Regexp.new(/(?<=\"\b#{key}\b\"\s\=\>\s)\"(?<value>.+)\"/)
|
102
|
+
result = `plutil -p \"#{info_plist_path}\"`.match(expr)
|
103
|
+
result.nil? ? '' : result[:value]
|
104
|
+
end
|
105
|
+
|
106
|
+
#####################################################
|
107
|
+
# @!group Documentation
|
108
|
+
#####################################################
|
109
|
+
|
110
|
+
def self.description
|
111
|
+
"Setup Yalantis-specific environment for the Firebase Distribution"
|
112
|
+
end
|
113
|
+
|
114
|
+
def self.details
|
115
|
+
# Optional:
|
116
|
+
# this is your chance to provide a more detailed description of this action
|
117
|
+
"Login to the Firebase using Project's Service Account credentials. Set value for the Firebase Project ID, App ID"
|
118
|
+
end
|
119
|
+
|
120
|
+
def self.available_options
|
121
|
+
[
|
122
|
+
FastlaneCore::ConfigItem.new(
|
123
|
+
key: :workspace,
|
124
|
+
env_name: 'GYM_WORKSPACE',
|
125
|
+
description: 'Path to the workspace file',
|
126
|
+
default_value_dynamic: false,
|
127
|
+
optional: true
|
128
|
+
),
|
129
|
+
FastlaneCore::ConfigItem.new(
|
130
|
+
key: :project,
|
131
|
+
env_name: 'GYM_PROJECT',
|
132
|
+
description: 'Path to the project file',
|
133
|
+
default_value_dynamic: false,
|
134
|
+
optional: true
|
135
|
+
),
|
136
|
+
FastlaneCore::ConfigItem.new(
|
137
|
+
key: :scheme,
|
138
|
+
env_name: 'GYM_SCHEME',
|
139
|
+
description: "The project's scheme. Make sure it's marked as `Shared`",
|
140
|
+
default_value_dynamic: false,
|
141
|
+
optional: false,
|
142
|
+
),
|
143
|
+
FastlaneCore::ConfigItem.new(
|
144
|
+
key: :configuration,
|
145
|
+
env_name: 'GYM_CONFIGURATION',
|
146
|
+
description: "The configuration to use when building the app. Defaults to \"Release\"",
|
147
|
+
optional: false
|
148
|
+
),
|
149
|
+
FastlaneCore::ConfigItem.new(
|
150
|
+
key: :xcodebuild_archive,
|
151
|
+
env_name: 'XCODEBUILD_ARCHIVE',
|
152
|
+
description: 'Path to the resulting .xcarchive. Optional if you use the _gym_ or _xcodebuild_ action',
|
153
|
+
default_value: Actions.lane_context[SharedValues::XCODEBUILD_ARCHIVE],
|
154
|
+
default_value_dynamic: true,
|
155
|
+
optional: false,
|
156
|
+
verify_block: proc do |value|
|
157
|
+
UI.user_error!("firebase_distribution_setup: Couldn't find .xcarchive file at path '#{value}'") unless File.exist?(value)
|
158
|
+
end
|
159
|
+
),
|
160
|
+
FastlaneCore::ConfigItem.new(
|
161
|
+
key: :google_application_credentials_dir,
|
162
|
+
env_name: 'GOOGLE_APPLICATION_CREDENTIALS_DIR',
|
163
|
+
description: 'Directory for the Google Application Credentials on the local machine. Ignored when `GOOGLE_APPLICATION_CREDENTIALS` has been set',
|
164
|
+
default_value: 'google-application-credentials',
|
165
|
+
optional: false
|
166
|
+
),
|
167
|
+
FastlaneCore::ConfigItem.new(
|
168
|
+
key: :google_application_credentials,
|
169
|
+
env_name: 'GOOGLE_APPLICATION_CREDENTIALS',
|
170
|
+
description: 'Custom path for the Google Application Credentials. If not set will be inferred based on the :firebase_setup_keys_dir variable and a Project ID',
|
171
|
+
optional: true
|
172
|
+
)
|
173
|
+
]
|
174
|
+
end
|
175
|
+
|
176
|
+
def self.authors
|
177
|
+
["Dima Vorona", "Yalantis"]
|
178
|
+
end
|
179
|
+
|
180
|
+
def self.is_supported?(platform)
|
181
|
+
true
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class InstallBrewDependenciesAction < Action
|
4
|
+
def self.run(params)
|
5
|
+
brewfile = File.join(ENV['PWD'], 'Brewfile')
|
6
|
+
sh('brew', 'bundle', '--file', Shellwords.escape(brewfile), '--no-upgrade') if File.exists?(brewfile)
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.authors
|
10
|
+
["Dima Vorona", "Yalantis"]
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.is_supported?(platform)
|
14
|
+
true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'fastlane/action'
|
2
|
+
require_relative '../helper/yalantis_ci_helper'
|
3
|
+
|
4
|
+
module Fastlane
|
5
|
+
module Actions
|
6
|
+
class YalantisCiAction < Action
|
7
|
+
def self.run(params)
|
8
|
+
UI.message("The yalantis_ci plugin is working!")
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.description
|
12
|
+
"Set of utilities and useful actions to help setup CI for Yalantis projects"
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.authors
|
16
|
+
["Dima Vorona"]
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.return_value
|
20
|
+
# If your method provides a return value, you can describe here what it does
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.details
|
24
|
+
# Optional:
|
25
|
+
"This plugin provides tools that setup Firebase, setup proper match repo branch name based on the project Unique ID (based on Team ID and a project name), syncs AppStore Connect API keys, kbridges cocoapod keys plugin to sync and share keys, stored in an encrypted repo just as Match does"
|
26
|
+
end
|
27
|
+
|
28
|
+
def self.available_options
|
29
|
+
[
|
30
|
+
# FastlaneCore::ConfigItem.new(key: :your_option,
|
31
|
+
# env_name: "YALANTIS_CI_YOUR_OPTION",
|
32
|
+
# description: "A description of your option",
|
33
|
+
# optional: false,
|
34
|
+
# type: String)
|
35
|
+
]
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.is_supported?(platform)
|
39
|
+
# Adjust this if your plugin only works for a particular platform (iOS vs. Android, for example)
|
40
|
+
# See: https://docs.fastlane.tools/advanced/#control-configuration-by-lane-and-by-platform
|
41
|
+
#
|
42
|
+
# [:ios, :mac, :android].include?(platform)
|
43
|
+
true
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fastlane_core/ui/ui'
|
2
|
+
|
3
|
+
module Fastlane
|
4
|
+
UI = FastlaneCore::UI unless Fastlane.const_defined?("UI")
|
5
|
+
|
6
|
+
module Helper
|
7
|
+
class YalantisCiHelper
|
8
|
+
# class methods that you define here become available in your action
|
9
|
+
# as `Helper::YalantisCiHelper.your_method`
|
10
|
+
#
|
11
|
+
def self.show_message
|
12
|
+
UI.message("Hello from the yalantis_ci plugin helper!")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,192 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: fastlane-plugin-yalantis_ci
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dima Vorona
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-03-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: fastlane-plugin-firebase_app_distribution
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec_junit_formatter
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 0.49.1
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 0.49.1
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop-require_tools
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: simplecov
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: fastlane
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '2.0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '2.0'
|
153
|
+
description:
|
154
|
+
email: dmytro.vorona@yalantis.net
|
155
|
+
executables: []
|
156
|
+
extensions: []
|
157
|
+
extra_rdoc_files: []
|
158
|
+
files:
|
159
|
+
- LICENSE
|
160
|
+
- README.md
|
161
|
+
- lib/fastlane/plugin/yalantis_ci.rb
|
162
|
+
- lib/fastlane/plugin/yalantis_ci/actions/ci_setup.rb
|
163
|
+
- lib/fastlane/plugin/yalantis_ci/actions/ci_teardown.rb
|
164
|
+
- lib/fastlane/plugin/yalantis_ci/actions/firebase_distribution_setup.rb
|
165
|
+
- lib/fastlane/plugin/yalantis_ci/actions/install_brew_dependencies.rb
|
166
|
+
- lib/fastlane/plugin/yalantis_ci/actions/yalantis_ci_action.rb
|
167
|
+
- lib/fastlane/plugin/yalantis_ci/helper/yalantis_ci_helper.rb
|
168
|
+
- lib/fastlane/plugin/yalantis_ci/version.rb
|
169
|
+
homepage:
|
170
|
+
licenses:
|
171
|
+
- MIT
|
172
|
+
metadata: {}
|
173
|
+
post_install_message:
|
174
|
+
rdoc_options: []
|
175
|
+
require_paths:
|
176
|
+
- lib
|
177
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
178
|
+
requirements:
|
179
|
+
- - ">="
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
182
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - ">="
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '0'
|
187
|
+
requirements: []
|
188
|
+
rubygems_version: 3.0.3
|
189
|
+
signing_key:
|
190
|
+
specification_version: 4
|
191
|
+
summary: Set of utilities and useful actions to help setup CI for Yalantis projects
|
192
|
+
test_files: []
|