fastlane-plugin-stream_actions 0.3.1 → 0.3.3

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: 3ce9c877edbbeedd2f1b8964f799c5a46187ae5eface42c07a5134420d17c218
4
- data.tar.gz: c37c1692a84c4035f1f53203fe21b8a98e159890b57df75816a97afcbc202cc5
3
+ metadata.gz: '09e99fe9162cf2f2e5504601cb257329a35d3121b952b142d9765134fd05c8ca'
4
+ data.tar.gz: 81c2868f9287640c4d900f2b05b1eafacdde21c29e999df61994366e2ef4848f
5
5
  SHA512:
6
- metadata.gz: 4c14cde70127520818a7788e1e050ce332b0a3398d46d29e08db1d288fc8d3225272fd09b7fe69f7d66c839959897e48bdbe9a4efffead749f8a1f22e33c5557
7
- data.tar.gz: f18254f28271bfe4c1dbeaae7d1835579dc79f572fb0f2eac9f72b29bf05f7162fe49ece3ba3274cc78af898d33ea732d63f1cbb2d4ba6127716467e0bb5b284
6
+ metadata.gz: c06183ce1fd9e342677005f5e539f5008c2a4f24958bc3e49c5655b4d68bb752971df617d311efc7a76af972496102e323e16e2da3dbbccfe01915bccb8563c4
7
+ data.tar.gz: d52f880891dba3d28f202dde9fcdc4a732122e8d81fbc18e270be4a2e72cc8b13e82bfb9e1ba3d5a1c8600edc551e0a3abee63c84456bd1cd3e7b9048b41247c
@@ -1,37 +1,43 @@
1
1
  module Fastlane
2
2
  module Actions
3
- class IosSdkReleaseAction < Action
3
+ class ReleaseIosSdkAction < Action
4
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
- )
5
+ podspecs = []
6
+ (params[:podspec_names] || params[:sdk_names]).each do |sdk|
7
+ podspecs << (sdk.include?('.podspec') ? sdk : "#{sdk}.podspec")
14
8
  end
15
9
 
16
- ensure_release_tag_is_new(version_number)
10
+ if params[:update_version_numbers]
11
+ ensure_everything_is_set_up(params)
17
12
 
18
- changes = other_action.touch_changelog(
19
- release_version: version_number,
20
- github_repo: params[:github_repo],
21
- changelog_path: params[:changelog_path]
22
- )
13
+ version_number = ''
14
+ params[:sdk_names].each do |target|
15
+ version_number = other_action.increment_version_number_in_plist(
16
+ target: target,
17
+ version_number: params[:version],
18
+ bump_type: params[:bump_type]
19
+ )
20
+ end
23
21
 
24
- podspecs = []
25
- params[:sdk_names].each { |sdk| podspecs << "#{sdk}.podspec" }
22
+ ensure_release_tag_is_new(version_number)
26
23
 
27
- podspecs.each do |podspec|
28
- UI.user_error!("Podspec #{podspec} does not exist!") unless File.exist?(podspec)
29
- other_action.version_bump_podspec(path: podspec, version_number: version_number)
30
- end
24
+ changes = other_action.touch_changelog(
25
+ release_version: version_number,
26
+ github_repo: params[:github_repo],
27
+ changelog_path: params[:changelog_path]
28
+ )
29
+
30
+ podspecs.each do |podspec|
31
+ UI.user_error!("Podspec #{podspec} does not exist!") unless File.exist?(podspec)
32
+ other_action.version_bump_podspec(path: podspec, version_number: version_number)
33
+ end
31
34
 
32
- sh("git checkout -b release/#{version_number}") if params[:create_pull_request]
35
+ params[:extra_changes].call(version_number) if params[:extra_changes]
33
36
 
34
- commit_changes(version_number)
37
+ sh("git checkout -b release/#{version_number}") if params[:create_pull_request]
38
+
39
+ commit_changes(version_number)
40
+ end
35
41
 
36
42
  if params[:create_pull_request]
37
43
  create_pull_request(
@@ -43,24 +49,38 @@ module Fastlane
43
49
  body: changes.to_s
44
50
  )
45
51
  UI.success("Successfully started release #{version_number}! 🚢")
46
- else
47
- other_action.publish_ios_sdk_release(
52
+ elsif params[:publish_release]
53
+ version_number ||= params[:version]
54
+
55
+ ensure_everything_is_set_up(params)
56
+ ensure_release_tag_is_new(version_number)
57
+
58
+ changes ||= other_action.read_changelog(
48
59
  version: version_number,
49
- sdk_names: params[:sdk_names],
50
- github_repo: params[:github_repo],
51
- github_token: params[:github_token],
52
- check_git_status: params[:check_git_status],
53
- check_branch: params[:check_branch],
54
60
  changelog_path: params[:changelog_path]
55
61
  )
62
+
63
+ release_details = other_action.set_github_release(
64
+ repository_name: params[:github_repo],
65
+ api_token: params[:github_token],
66
+ name: version_number,
67
+ tag_name: version_number,
68
+ description: changes,
69
+ commitish: ENV['BRANCH_NAME'] || other_action.git_branch,
70
+ upload_assets: params[:upload_assets]
71
+ )
72
+
73
+ podspecs.each { |podspec| other_action.pod_push_safely(podspec: podspec) }
74
+
75
+ UI.success("Github release v#{version_number} was created, please visit #{release_details['html_url']} to see it! 🚢")
56
76
  end
57
77
  end
58
78
 
59
79
  def self.ensure_everything_is_set_up(params)
60
- other_action.ensure_git_branch(branch: 'develop') if params[:check_branch]
61
- other_action.ensure_git_status_clean if params[:check_git_status]
80
+ other_action.ensure_git_branch(branch: 'main') if params[:publish_release]
81
+ other_action.ensure_git_status_clean unless params[:skip_git_status_check]
62
82
 
63
- UI.user_error!('Please set GITHUB_TOKEN environment value.') if ENV['GITHUB_TOKEN'].nil?
83
+ UI.user_error!('Please set GITHUB_TOKEN environment value.') if params[:github_token].nil?
64
84
 
65
85
  if params[:version].nil? && !["patch", "minor", "major"].include?(params[:bump_type])
66
86
  UI.user_error!("Please use type parameter with one of the options: type:patch, type:minor, type:major")
@@ -113,6 +133,12 @@ module Fastlane
113
133
  UI.user_error!("SDK names array has to be specified") unless sdks.kind_of?(Array) && sdks.size.positive?
114
134
  end
115
135
  ),
136
+ FastlaneCore::ConfigItem.new(
137
+ key: :podspec_names,
138
+ description: 'Podspec names to release',
139
+ is_string: false,
140
+ optional: true
141
+ ),
116
142
  FastlaneCore::ConfigItem.new(
117
143
  env_name: 'GITHUB_REPOSITORY',
118
144
  key: :github_repo,
@@ -124,16 +150,10 @@ module Fastlane
124
150
  description: 'GITHUB_TOKEN environment variable'
125
151
  ),
126
152
  FastlaneCore::ConfigItem.new(
127
- key: :check_git_status,
128
- description: 'Ensure git status is clean',
129
- is_string: false,
130
- default_value: true
131
- ),
132
- FastlaneCore::ConfigItem.new(
133
- key: :check_branch,
134
- description: 'Ensure git branch is develop',
153
+ key: :skip_git_status_check,
154
+ description: 'Skip git status check',
135
155
  is_string: false,
136
- default_value: true
156
+ optional: true
137
157
  ),
138
158
  FastlaneCore::ConfigItem.new(
139
159
  key: :changelog_path,
@@ -142,11 +162,35 @@ module Fastlane
142
162
  is_string: true,
143
163
  default_value: './CHANGELOG.md'
144
164
  ),
165
+ FastlaneCore::ConfigItem.new(
166
+ key: :extra_changes,
167
+ description: 'Lambda with extra changes to be commited to the release',
168
+ is_string: false,
169
+ default_value: false
170
+ ),
145
171
  FastlaneCore::ConfigItem.new(
146
172
  key: :create_pull_request,
147
- description: 'Create pull request? Otherwise, will release straight away',
173
+ description: 'Create pull request from release branch to main',
148
174
  is_string: false,
149
- default_value: true
175
+ default_value: false
176
+ ),
177
+ FastlaneCore::ConfigItem.new(
178
+ key: :update_version_numbers,
179
+ description: 'Update release version numbers in podspecs and plist files',
180
+ is_string: false,
181
+ default_value: false
182
+ ),
183
+ FastlaneCore::ConfigItem.new(
184
+ key: :publish_release,
185
+ description: 'Publish release to GitHub and CocoaPods',
186
+ is_string: false,
187
+ default_value: false
188
+ ),
189
+ FastlaneCore::ConfigItem.new(
190
+ key: :upload_assets,
191
+ description: 'Path to assets to be uploaded with the release',
192
+ is_string: false,
193
+ optional: true
150
194
  )
151
195
  ]
152
196
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = '0.3.1'
3
+ VERSION = '0.3.3'
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.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - GetStream
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-18 00:00:00.000000000 Z
11
+ date: 2023-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -233,12 +233,11 @@ files:
233
233
  - lib/fastlane/plugin/stream_actions/actions/allure_create_testcase.rb
234
234
  - lib/fastlane/plugin/stream_actions/actions/allure_run_testplan.rb
235
235
  - lib/fastlane/plugin/stream_actions/actions/custom_match.rb
236
- - lib/fastlane/plugin/stream_actions/actions/ios_sdk_release.rb
237
236
  - lib/fastlane/plugin/stream_actions/actions/is_check_required.rb
238
237
  - lib/fastlane/plugin/stream_actions/actions/pod_push_safely.rb
239
238
  - lib/fastlane/plugin/stream_actions/actions/prepare_simulator.rb
240
- - lib/fastlane/plugin/stream_actions/actions/publish_ios_sdk_release.rb
241
239
  - lib/fastlane/plugin/stream_actions/actions/read_changelog.rb
240
+ - lib/fastlane/plugin/stream_actions/actions/release_ios_sdk.rb
242
241
  - lib/fastlane/plugin/stream_actions/actions/retrieve_xctest_names.rb
243
242
  - lib/fastlane/plugin/stream_actions/actions/testflight_build.rb
244
243
  - lib/fastlane/plugin/stream_actions/actions/touch_changelog.rb
@@ -1,109 +0,0 @@
1
- module Fastlane
2
- module Actions
3
- class PublishIosSdkReleaseAction < Action
4
- def self.run(params)
5
- ensure_everything_is_set_up(params)
6
- ensure_release_tag_is_new(params[:version])
7
-
8
- changes = other_action.read_changelog(
9
- version: params[:version],
10
- changelog_path: params[:changelog_path]
11
- )
12
-
13
- podspecs = []
14
- params[:sdk_names].each { |sdk| podspecs << "#{sdk}.podspec" }
15
-
16
- release_details = other_action.set_github_release(
17
- repository_name: params[:github_repo],
18
- api_token: params[:github_token],
19
- name: params[:version],
20
- tag_name: params[:version],
21
- description: changes,
22
- commitish: ENV['BRANCH_NAME'] || other_action.git_branch
23
- )
24
-
25
- podspecs.each { |podspec| other_action.pod_push_safely(podspec: podspec, sync: params[:pod_sync] & true) }
26
-
27
- UI.success("Github release v#{params[:version]} was created, please visit #{release_details['html_url']} to see it! 🚢")
28
- end
29
-
30
- def self.ensure_everything_is_set_up(params)
31
- other_action.ensure_git_branch(branch: 'main') if params[:check_branch]
32
- other_action.ensure_git_status_clean if params[:check_git_status]
33
- end
34
-
35
- def self.ensure_release_tag_is_new(version_number)
36
- if other_action.git_tag_exists(tag: version_number)
37
- UI.user_error!("Tag for version #{version_number} already exists!")
38
- else
39
- UI.success("Ignore the red warning above. Tag for version #{version_number} is alright!")
40
- end
41
- end
42
-
43
- #####################################################
44
- # @!group Documentation
45
- #####################################################
46
-
47
- def self.description
48
- 'Publishes iOS SDKs to GitHub and CocoaPods'
49
- end
50
-
51
- def self.available_options
52
- [
53
- FastlaneCore::ConfigItem.new(
54
- key: :version,
55
- description: 'Release version',
56
- optional: true
57
- ),
58
- FastlaneCore::ConfigItem.new(
59
- key: :sdk_names,
60
- description: 'SDK names to release',
61
- is_string: false,
62
- verify_block: proc do |sdks|
63
- UI.user_error!("SDK names array has to be specified") unless sdks.kind_of?(Array) && sdks.size.positive?
64
- end
65
- ),
66
- FastlaneCore::ConfigItem.new(
67
- env_name: 'GITHUB_REPOSITORY',
68
- key: :github_repo,
69
- description: 'Github repository name'
70
- ),
71
- FastlaneCore::ConfigItem.new(
72
- env_name: 'GITHUB_TOKEN',
73
- key: :github_token,
74
- description: 'GITHUB_TOKEN environment variable'
75
- ),
76
- FastlaneCore::ConfigItem.new(
77
- key: :check_git_status,
78
- description: 'Ensure git status is clean',
79
- is_string: false,
80
- default_value: true
81
- ),
82
- FastlaneCore::ConfigItem.new(
83
- key: :check_branch,
84
- description: 'Ensure git branch is main',
85
- is_string: false,
86
- default_value: true
87
- ),
88
- FastlaneCore::ConfigItem.new(
89
- key: :pod_sync,
90
- description: 'If validation depends on other recently pushed pods, synchronize',
91
- is_string: false,
92
- default_value: false
93
- ),
94
- FastlaneCore::ConfigItem.new(
95
- key: :changelog_path,
96
- env_name: 'FL_CHANGELOG_PATH',
97
- description: 'The path to your project CHANGELOG.md',
98
- is_string: true,
99
- default_value: './CHANGELOG.md'
100
- )
101
- ]
102
- end
103
-
104
- def self.supported?(_platform)
105
- [:ios].include?(platform)
106
- end
107
- end
108
- end
109
- end