fastlane-plugin-stream_actions 0.1.13 → 0.1.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6ec0be8f79dbac1b9419e0002bef670aa32499f1cd195ceb62bfc3d9497e86f
4
- data.tar.gz: 618f1e7b9c431c44172ec0489f4d65d80fa0e6223546dcbd45f7a3a716181f01
3
+ metadata.gz: fcb13b3f09d78254a4fd4bd0aedfaa73dbd01471f286048fc262ad5519743551
4
+ data.tar.gz: 525d059e5ad30f690e8c28d575f4e752ce38ce01390f399d5cf867d9a473f560
5
5
  SHA512:
6
- metadata.gz: 671bfd2e3764e97c8f16d0f5ce714b3fa8284cfa9424ce465e6853a16e9307494da5bbe5e5b2b411dcaa313d315be7139000bd56a5cfebdaa04b7f2fee60aa61
7
- data.tar.gz: f09fe51ae54b4678e789d62aefe39e81992274429d30e419459c413420c10659172d3963d41844e686be039ba0f7ceb68ff1a0fc8fe9ff44c055cce58e4ff11a
6
+ metadata.gz: 13f3f4538eddb334ab7a3fb408baf4bb3776737d6fee60575fc384c779b9b63a085bda1bb94a359d4d50f9618e18a1d8fb958697f883827753a2fdc2f9c55c5d
7
+ data.tar.gz: f15417504964bb1deebb850244be7c1de7bad5d5bf964838fe5779ae969338f8b33dcddbabbe2435c4d104a9f4efca0e29363341db6969fbc61eee0d3bf37a5e
@@ -25,7 +25,7 @@ module Fastlane
25
25
  #####################################################
26
26
 
27
27
  def self.description
28
- 'Analyzes the impact of changes on PR'
28
+ 'Installs or recreates all Certs and Profiles necessary for development and ad-hoc and registers a new device if required'
29
29
  end
30
30
 
31
31
  def self.available_options
@@ -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.13"
3
+ VERSION = "0.1.14"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-stream_actions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - GetStream
@@ -230,9 +230,10 @@ files:
230
230
  - lib/fastlane/plugin/stream_actions.rb
231
231
  - lib/fastlane/plugin/stream_actions/actions/custom_match.rb
232
232
  - lib/fastlane/plugin/stream_actions/actions/is_check_required.rb
233
- - lib/fastlane/plugin/stream_actions/actions/pod_push_safely.rb
234
233
  - lib/fastlane/plugin/stream_actions/actions/read_changelog.rb
234
+ - lib/fastlane/plugin/stream_actions/actions/release_ios_sdk.rb
235
235
  - lib/fastlane/plugin/stream_actions/actions/retrieve_xctest_names.rb
236
+ - lib/fastlane/plugin/stream_actions/actions/testflight_build.rb
236
237
  - lib/fastlane/plugin/stream_actions/actions/touch_changelog.rb
237
238
  - lib/fastlane/plugin/stream_actions/actions/update_testplan.rb
238
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
- other_action.pod_push(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