fastlane-plugin-stream_actions 0.1.12 → 0.1.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c23c0e7acb8b64508b6dd9b61106f03421146353e2937eed53110eb5725b1e9d
4
- data.tar.gz: 56ac3976b5c6cf39d28bd9836ad310fc684b607a470418901bf9e8adcd1e5137
3
+ metadata.gz: fcb13b3f09d78254a4fd4bd0aedfaa73dbd01471f286048fc262ad5519743551
4
+ data.tar.gz: 525d059e5ad30f690e8c28d575f4e752ce38ce01390f399d5cf867d9a473f560
5
5
  SHA512:
6
- metadata.gz: 685c33fca52dc107965782c137b6f27427c628e95763bd21b32c5bc6fd36ddb5c922056029d2fda0a449bd2931b0e1b6e8ab1f09bf5656eadc8af959d70c4bc7
7
- data.tar.gz: 83d1e564c0eab9fabf3887a153b60f0545678cae978c91156c40597e7f0b12f286a06e06d24bfda0bf6f9488d8871f38aee1c7740a00d227087db8857465d633
6
+ metadata.gz: 13f3f4538eddb334ab7a3fb408baf4bb3776737d6fee60575fc384c779b9b63a085bda1bb94a359d4d50f9618e18a1d8fb958697f883827753a2fdc2f9c55c5d
7
+ data.tar.gz: f15417504964bb1deebb850244be7c1de7bad5d5bf964838fe5779ae969338f8b33dcddbabbe2435c4d104a9f4efca0e29363341db6969fbc61eee0d3bf37a5e
@@ -0,0 +1,69 @@
1
+ module Fastlane
2
+ module Actions
3
+ class CustomMatchAction < Action
4
+ def self.run(params)
5
+ if params[:register_device]
6
+ device_name = other_action.prompt(text: 'Enter the device name: ')
7
+ device_udid = other_action.prompt(text: 'Enter the device UDID: ')
8
+ other_action.register_device(name: device_name, udid: device_udid)
9
+ params[:readonly] = false
10
+ end
11
+
12
+ %w[development adhoc appstore].each do |type|
13
+ other_action.match(
14
+ api_key: params[:api_key],
15
+ type: type,
16
+ app_identifier: params[:app_identifier],
17
+ readonly: params[:readonly] || true,
18
+ force_for_new_devices: !other_action.is_ci
19
+ )
20
+ end
21
+ end
22
+
23
+ #####################################################
24
+ # @!group Documentation
25
+ #####################################################
26
+
27
+ def self.description
28
+ 'Installs or recreates all Certs and Profiles necessary for development and ad-hoc and registers a new device if required'
29
+ end
30
+
31
+ def self.available_options
32
+ [
33
+ FastlaneCore::ConfigItem.new(
34
+ key: :api_key,
35
+ description: 'AppStore Connect API Key',
36
+ is_string: false,
37
+ verify_block: proc do |api_key|
38
+ UI.user_error!('AppStore Connect API Key has to be specified') unless api_key
39
+ end
40
+ ),
41
+ FastlaneCore::ConfigItem.new(
42
+ key: :app_identifier,
43
+ description: 'The bundle identifier(s) of your app (array of strings)',
44
+ is_string: false,
45
+ verify_block: proc do |id|
46
+ UI.user_error!("The bundle identifier(s) have to be specified") unless id.kind_of?(Array) && id.size.positive?
47
+ end
48
+ ),
49
+ FastlaneCore::ConfigItem.new(
50
+ key: :readonly,
51
+ is_string: false,
52
+ default_value: true,
53
+ description: 'If `readonly: true` (by default), installs all Certs and Profiles necessary for development and ad-hoc.\nIf `readonly: false`, recreates all Profiles necessary for development and ad-hoc, updates them locally and remotely'
54
+ ),
55
+ FastlaneCore::ConfigItem.new(
56
+ key: :register_device,
57
+ is_string: false,
58
+ default_value: false,
59
+ description: 'When `true` you will be asked to specify a name and UDID of new device to register'
60
+ )
61
+ ]
62
+ end
63
+
64
+ def self.supported?(_platform)
65
+ [:ios].include?(platform)
66
+ end
67
+ end
68
+ end
69
+ end
@@ -53,7 +53,7 @@ module Fastlane
53
53
  end
54
54
 
55
55
  def self.supported?(_platform)
56
- [:ios].include?(platform)
56
+ true
57
57
  end
58
58
  end
59
59
  end
@@ -0,0 +1,159 @@
1
+ module Fastlane
2
+ module Actions
3
+ class ReleaseIosSdkAction < Action
4
+ def self.run(params)
5
+ ensure_everything_is_set_up(params)
6
+
7
+ version_number = ''
8
+ params[:sdk_names].each do |target|
9
+ version_number = other_action.increment_version_number_in_plist(
10
+ target: target,
11
+ version_number: params[:version],
12
+ bump_type: params[:bump_type]
13
+ )
14
+ end
15
+
16
+ ensure_release_tag_is_new(version_number)
17
+
18
+ changes = other_action.read_changelog(version: version_number, changelog_path: params[:changelog_path])
19
+
20
+ podspecs = []
21
+ params[:sdk_names].each { |sdk| podspecs << "#{sdk}.podspec" }
22
+
23
+ podspecs.each do |podspec|
24
+ UI.user_error!("Podspec #{podspec} does not exist!") unless File.exist?(podspec)
25
+ other_action.pod_lib_lint(podspec: podspec, allow_warnings: true) unless params[:skip_pod_list]
26
+ other_action.version_bump_podspec(path: podspec, version_number: version_number)
27
+ end
28
+
29
+ commit_changes(version_number)
30
+
31
+ release_details = other_action.set_github_release(
32
+ repository_name: params[:github_repo],
33
+ api_token: ENV['GITHUB_TOKEN'],
34
+ name: version_number,
35
+ tag_name: version_number,
36
+ description: changes,
37
+ commitish: ENV['BRANCH_NAME'] || other_action.git_branch
38
+ )
39
+
40
+ podspecs.each { |podspec| pod_push_safely(podspec: podspec, sync: params[:pod_sync] & true) }
41
+
42
+ UI.success("Github release v#{version_number} was created, please visit #{release_details['html_url']} to see it! 🚢")
43
+ end
44
+
45
+ def self.ensure_everything_is_set_up(params)
46
+ other_action.ensure_git_branch(branch: 'main') if params[:check_release_branch]
47
+ other_action.ensure_git_status_clean if params[:check_git_status]
48
+
49
+ if params[:version].nil? && !["patch", "minor", "major"].include?(params[:bump_type])
50
+ UI.user_error!("Please use type parameter with one of the options: type:patch, type:minor, type:major")
51
+ end
52
+ end
53
+
54
+ def self.ensure_release_tag_is_new(version_number)
55
+ if other_action.git_tag_exists(tag: version_number)
56
+ UI.user_error!("Tag for version #{version_number} already exists!")
57
+ else
58
+ UI.success("Ignore the red warning above. Tag for version #{version_number} is alright!")
59
+ end
60
+ end
61
+
62
+ def self.commit_changes(version_number)
63
+ sh("git add -A")
64
+ UI.user_error!("Not committing changes") unless other_action.prompt(text: "Will commit changes. All looking good?", boolean: true)
65
+
66
+ sh("git commit -m 'Bump #{version_number}'")
67
+ UI.user_error!("Not pushing changes") unless other_action.prompt(text: "Will push changes. All looking good?", boolean: true)
68
+
69
+ other_action.push_to_git_remote(tags: true)
70
+ end
71
+
72
+ def self.pod_push_safely(params)
73
+ UI.message("Starting to push podspec: #{params[:podspec]}")
74
+ other_action.pod_push(path: params[:podspec], allow_warnings: true, synchronous: params[:sync])
75
+ rescue StandardError => e
76
+ UI.message(e)
77
+ UI.message("pod_push failed for #{params[:podspec]}. Waiting a minute until retry for trunk to get updated...")
78
+ sleep(60) # sleep for a minute, wait until trunk gets updates
79
+ pod_push_safely(params)
80
+ end
81
+
82
+ #####################################################
83
+ # @!group Documentation
84
+ #####################################################
85
+
86
+ def self.description
87
+ 'Releases iOS SDKs to GitHub and CocoaPods'
88
+ end
89
+
90
+ def self.available_options
91
+ [
92
+ FastlaneCore::ConfigItem.new(
93
+ key: :version,
94
+ description: 'Release version (not required if release type is set)',
95
+ optional: true
96
+ ),
97
+ FastlaneCore::ConfigItem.new(
98
+ key: :bump_type,
99
+ description: 'Release type (not required if release version is set)',
100
+ optional: true
101
+ ),
102
+ FastlaneCore::ConfigItem.new(
103
+ key: :sdk_names,
104
+ description: 'SDK names to release',
105
+ is_string: false,
106
+ verify_block: proc do |sdks|
107
+ UI.user_error!("SDK names array has to be specified") unless sdks.kind_of?(Array) && sdks.size.positive?
108
+ end
109
+ ),
110
+ FastlaneCore::ConfigItem.new(
111
+ env_name: 'GITHUB_REPOSITORY',
112
+ key: :github_repo,
113
+ description: 'Github repository name'
114
+ ),
115
+ FastlaneCore::ConfigItem.new(
116
+ env_name: 'GITHUB_TOKEN',
117
+ key: :github_token,
118
+ description: 'GITHUB_TOKEN env var has to be set up'
119
+ ),
120
+ FastlaneCore::ConfigItem.new(
121
+ key: :check_git_status,
122
+ description: 'Ensure git status is clean',
123
+ is_string: false,
124
+ default_value: true
125
+ ),
126
+ FastlaneCore::ConfigItem.new(
127
+ key: :check_release_branch,
128
+ description: 'Ensure git branch is main',
129
+ is_string: false,
130
+ default_value: true
131
+ ),
132
+ FastlaneCore::ConfigItem.new(
133
+ key: :skip_pod_list,
134
+ description: 'Skip pod lib lint action',
135
+ is_string: false,
136
+ default_value: false
137
+ ),
138
+ FastlaneCore::ConfigItem.new(
139
+ key: :pod_sync,
140
+ description: 'If validation depends on other recently pushed pods, synchronize',
141
+ is_string: false,
142
+ default_value: false
143
+ ),
144
+ FastlaneCore::ConfigItem.new(
145
+ key: :changelog_path,
146
+ env_name: 'FL_CHANGELOG_PATH',
147
+ description: 'The path to your project CHANGELOG.md',
148
+ is_string: true,
149
+ default_value: './CHANGELOG.md'
150
+ )
151
+ ]
152
+ end
153
+
154
+ def self.supported?(_platform)
155
+ [:ios].include?(platform)
156
+ end
157
+ end
158
+ end
159
+ end
@@ -0,0 +1,125 @@
1
+ module Fastlane
2
+ module Actions
3
+ class TestflightBuildAction < Action
4
+ def self.run(params)
5
+ build_number = other_action.latest_testflight_build_number(
6
+ app_identifier: params[:app_identifier],
7
+ api_key: params[:api_key]
8
+ ) + 1
9
+ other_action.increment_build_number(build_number: build_number.to_s)
10
+
11
+ other_action.gym(
12
+ project: params[:xcode_project],
13
+ scheme: params[:app_target],
14
+ configuration: 'Release',
15
+ export_method: 'app-store',
16
+ export_options: params[:testflight_export_options],
17
+ clean: true,
18
+ include_symbols: true,
19
+ output_directory: params[:output_directory]
20
+ )
21
+
22
+ current_branch = ENV['BRANCH_NAME'] || other_action.git_branch
23
+ external_groups = current_branch == 'main' ? ['Public Link'] : []
24
+ other_action.pilot(
25
+ api_key: params[:api_key],
26
+ team_id: '118902954',
27
+ app_identifier: params[:app_identifier],
28
+ app_platform: 'ios',
29
+ ipa: lane_context[SharedValues::IPA_OUTPUT_PATH],
30
+ groups: external_groups,
31
+ distribute_external: external_groups.any?,
32
+ notify_external_testers: external_groups.any?,
33
+ reject_build_waiting_for_review: true,
34
+ changelog: testflight_instructions(params)
35
+ )
36
+
37
+ if params[:github_pr_num]
38
+ message = "Build for regression testing №#{build_number} has been uploaded to TestFlight 🎁"
39
+ sh("gh pr comment #{params[:github_pr_num]} -b '#{message}'")
40
+ end
41
+ end
42
+
43
+ def self.testflight_instructions(params)
44
+ version_number = other_action.get_version_number(target: params[:sdk_target])[/\d+\.\d+\.\d/]
45
+ if ENV['GITHUB_EVENT_NAME'] == 'pull_request'
46
+ sha = ENV['GITHUB_SHA'] ? ENV['GITHUB_SHA'][0..8] : sh('git rev-parse --short HEAD')
47
+ "This is the build for Regression testing on release candidate v#{version_number} (sha: #{sha})."
48
+ else
49
+ "This is the official sample app built with iOS #{params[:sdk_target]} SDK v#{version_number}. It's designed " \
50
+ 'to highlight engaging features and new improvements to the SDK, but remember that this is just one ' \
51
+ 'possible implementation. You can start your own by borrowing and customizing the code from this ' \
52
+ "sample, or build something completely different using Stream's components."
53
+ end
54
+ end
55
+
56
+ #####################################################
57
+ # @!group Documentation
58
+ #####################################################
59
+
60
+ def self.description
61
+ 'Builds a DemoApp and uploads it to TestFlight'
62
+ end
63
+
64
+ def self.available_options
65
+ [
66
+ FastlaneCore::ConfigItem.new(
67
+ key: :api_key,
68
+ description: 'AppStore Connect API Key',
69
+ is_string: false,
70
+ verify_block: proc do |api_key|
71
+ UI.user_error!('AppStore Connect API Key has to be specified') unless api_key
72
+ end
73
+ ),
74
+ FastlaneCore::ConfigItem.new(
75
+ key: :xcode_project,
76
+ description: 'Path to the Xcode project',
77
+ verify_block: proc do |path|
78
+ UI.user_error!('Path to the Xcode project has to be specified') unless path
79
+ end
80
+ ),
81
+ FastlaneCore::ConfigItem.new(
82
+ key: :sdk_target,
83
+ description: 'SDK target name',
84
+ verify_block: proc do |target|
85
+ UI.user_error!('SDK target name has to be specified') unless target
86
+ end
87
+ ),
88
+ FastlaneCore::ConfigItem.new(
89
+ key: :app_target,
90
+ description: 'DemoApp target name',
91
+ verify_block: proc do |target|
92
+ UI.user_error!('DemoApp target name has to be specified') unless target
93
+ end
94
+ ),
95
+ FastlaneCore::ConfigItem.new(
96
+ key: :app_identifier,
97
+ description: 'DemoApp bundle identifier',
98
+ verify_block: proc do |id|
99
+ UI.user_error!('DemoApp bundle identifier has to be specified') unless id
100
+ end
101
+ ),
102
+ FastlaneCore::ConfigItem.new(
103
+ key: :testflight_export_options,
104
+ description: 'We have to pass manually since `gym` detects profiles from `match` and that breaks it',
105
+ default_value: './fastlane/testflight_export_options.plist'
106
+ ),
107
+ FastlaneCore::ConfigItem.new(
108
+ key: :output_directory,
109
+ description: 'Output directory for the build',
110
+ default_value: 'archives'
111
+ ),
112
+ FastlaneCore::ConfigItem.new(
113
+ env_name: 'GITHUB_PR_NUM',
114
+ key: :github_pr_num,
115
+ description: 'GitHub PR number'
116
+ )
117
+ ]
118
+ end
119
+
120
+ def self.supported?(_platform)
121
+ true
122
+ end
123
+ end
124
+ end
125
+ end
@@ -19,7 +19,7 @@ module Fastlane
19
19
  #####################################################
20
20
 
21
21
  def self.description
22
- 'Retrieves test names from xctestrun file'
22
+ 'Adds environment variables to a test plan'
23
23
  end
24
24
 
25
25
  def self.available_options
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = "0.1.12"
3
+ VERSION = "0.1.14"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-stream_actions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.12
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - GetStream
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-03 00:00:00.000000000 Z
11
+ date: 2022-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -228,10 +228,12 @@ extra_rdoc_files: []
228
228
  files:
229
229
  - README.md
230
230
  - lib/fastlane/plugin/stream_actions.rb
231
+ - lib/fastlane/plugin/stream_actions/actions/custom_match.rb
231
232
  - lib/fastlane/plugin/stream_actions/actions/is_check_required.rb
232
- - lib/fastlane/plugin/stream_actions/actions/pod_push_safely.rb
233
233
  - lib/fastlane/plugin/stream_actions/actions/read_changelog.rb
234
+ - lib/fastlane/plugin/stream_actions/actions/release_ios_sdk.rb
234
235
  - lib/fastlane/plugin/stream_actions/actions/retrieve_xctest_names.rb
236
+ - lib/fastlane/plugin/stream_actions/actions/testflight_build.rb
235
237
  - lib/fastlane/plugin/stream_actions/actions/touch_changelog.rb
236
238
  - lib/fastlane/plugin/stream_actions/actions/update_testplan.rb
237
239
  - lib/fastlane/plugin/stream_actions/version.rb
@@ -1,48 +0,0 @@
1
- module Fastlane
2
- module Actions
3
- class PodPushSafelyAction < Action
4
- def self.run(params)
5
- pod_push_safely(params)
6
- end
7
-
8
- def self.pod_push_safely(params)
9
- UI.message("Starting to push podspec: #{params[:podspec]}")
10
- Fastlane::Actions::PodPushAction.run(path: params[:podspec], allow_warnings: true, synchronous: params[:sync])
11
- rescue StandardError => e
12
- UI.message(e)
13
- UI.message("pod_push failed for #{params[:podspec]}. Waiting a minute until retry for trunk to get updated...")
14
- sleep(60) # sleep for a minute, wait until trunk gets updates
15
- pod_push_safely(params)
16
- end
17
-
18
- #####################################################
19
- # @!group Documentation
20
- #####################################################
21
-
22
- def self.description
23
- 'Releases pod to cocoapods trunk'
24
- end
25
-
26
- def self.available_options
27
- [
28
- FastlaneCore::ConfigItem.new(
29
- key: :podspec,
30
- description: 'Podspec path',
31
- verify_block: proc do |pod|
32
- UI.user_error!("Podspec path has to be specified") unless pod
33
- end
34
- ),
35
- FastlaneCore::ConfigItem.new(
36
- key: :sync,
37
- description: 'When `sync` is false, pod trunk push is run asynchronously',
38
- is_string: false
39
- )
40
- ]
41
- end
42
-
43
- def self.supported?(_platform)
44
- [:ios].include?(platform)
45
- end
46
- end
47
- end
48
- end