fastlane-plugin-stream_actions 0.3.3 → 0.3.5

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: '09e99fe9162cf2f2e5504601cb257329a35d3121b952b142d9765134fd05c8ca'
4
- data.tar.gz: 81c2868f9287640c4d900f2b05b1eafacdde21c29e999df61994366e2ef4848f
3
+ metadata.gz: 2348c066c6f7b3b07a3e04f65e613ed12870b6134e58ab0890dc375aceb123d3
4
+ data.tar.gz: b94be2c268cc235aeef8fa541a2563a63b30081213dbfc696da9b79793eb980d
5
5
  SHA512:
6
- metadata.gz: c06183ce1fd9e342677005f5e539f5008c2a4f24958bc3e49c5655b4d68bb752971df617d311efc7a76af972496102e323e16e2da3dbbccfe01915bccb8563c4
7
- data.tar.gz: d52f880891dba3d28f202dde9fcdc4a732122e8d81fbc18e270be4a2e72cc8b13e82bfb9e1ba3d5a1c8600edc551e0a3abee63c84456bd1cd3e7b9048b41247c
6
+ metadata.gz: fccb0bf830acc4366a2171f01616df0666e60e7adc8dbb0affcf62d5311dc59a846d783370d25605407274f8ec9a9f6aabea0cb4ce8b6d1622045ce225626128
7
+ data.tar.gz: ba1b73d15649bbb8906a2f1ab044ad1af810b71e696a26686fdff59bf63caf2bbc8f9d7c7a1d990c9c09fd4bde85aabe6b760011e5037eadf88e505f4ac26ca4
@@ -0,0 +1,113 @@
1
+ module Fastlane
2
+ module Actions
3
+ class PublishIosSdkAction < Action
4
+ def self.run(params)
5
+ podspecs = []
6
+ (params[:podspec_names] || params[:sdk_names]).each do |sdk|
7
+ podspecs << (sdk.include?('.podspec') ? sdk : "#{sdk}.podspec")
8
+ end
9
+
10
+ version_number = params[:version]
11
+
12
+ ensure_everything_is_set_up(params)
13
+ ensure_release_tag_is_new(version_number)
14
+
15
+ changes = other_action.read_changelog(
16
+ version: version_number,
17
+ changelog_path: params[:changelog_path]
18
+ )
19
+
20
+ release_details = other_action.set_github_release(
21
+ repository_name: params[:github_repo],
22
+ api_token: params[:github_token],
23
+ name: version_number,
24
+ tag_name: version_number,
25
+ description: changes,
26
+ commitish: ENV['BRANCH_NAME'] || other_action.git_branch,
27
+ upload_assets: params[:upload_assets]
28
+ )
29
+
30
+ podspecs.each { |podspec| other_action.pod_push_safely(podspec: podspec) }
31
+
32
+ UI.success("Github release v#{version_number} was created, please visit #{release_details['html_url']} to see it! 🚢")
33
+ end
34
+
35
+ def self.ensure_everything_is_set_up(params)
36
+ # other_action.ensure_git_branch(branch: 'main')
37
+ other_action.ensure_git_status_clean unless params[:skip_git_status_check]
38
+ end
39
+
40
+ def self.ensure_release_tag_is_new(version_number)
41
+ if other_action.git_tag_exists(tag: version_number)
42
+ UI.user_error!("Tag for version #{version_number} already exists!")
43
+ else
44
+ UI.success("Ignore the red warning above. Tag for version #{version_number} is alright!")
45
+ end
46
+ end
47
+
48
+ #####################################################
49
+ # @!group Documentation
50
+ #####################################################
51
+
52
+ def self.description
53
+ 'Publish iOS SDKs'
54
+ end
55
+
56
+ def self.available_options
57
+ [
58
+ FastlaneCore::ConfigItem.new(
59
+ key: :version,
60
+ description: 'Release version (not required if release type is set)'
61
+ ),
62
+ FastlaneCore::ConfigItem.new(
63
+ key: :sdk_names,
64
+ description: 'SDK names to release',
65
+ is_string: false,
66
+ verify_block: proc do |sdks|
67
+ UI.user_error!("SDK names array has to be specified") unless sdks.kind_of?(Array) && sdks.size.positive?
68
+ end
69
+ ),
70
+ FastlaneCore::ConfigItem.new(
71
+ key: :podspec_names,
72
+ description: 'Podspec names to release',
73
+ is_string: false,
74
+ optional: true
75
+ ),
76
+ FastlaneCore::ConfigItem.new(
77
+ env_name: 'GITHUB_REPOSITORY',
78
+ key: :github_repo,
79
+ description: 'Github repository name'
80
+ ),
81
+ FastlaneCore::ConfigItem.new(
82
+ env_name: 'GITHUB_TOKEN',
83
+ key: :github_token,
84
+ description: 'GITHUB_TOKEN environment variable'
85
+ ),
86
+ FastlaneCore::ConfigItem.new(
87
+ key: :skip_git_status_check,
88
+ description: 'Skip git status check',
89
+ is_string: false,
90
+ optional: true
91
+ ),
92
+ FastlaneCore::ConfigItem.new(
93
+ key: :changelog_path,
94
+ env_name: 'FL_CHANGELOG_PATH',
95
+ description: 'The path to your project CHANGELOG.md',
96
+ is_string: true,
97
+ default_value: './CHANGELOG.md'
98
+ ),
99
+ FastlaneCore::ConfigItem.new(
100
+ key: :upload_assets,
101
+ description: 'Path to assets to be uploaded with the release',
102
+ is_string: false,
103
+ optional: true
104
+ )
105
+ ]
106
+ end
107
+
108
+ def self.supported?(_platform)
109
+ [:ios].include?(platform)
110
+ end
111
+ end
112
+ end
113
+ end
@@ -7,38 +7,36 @@ module Fastlane
7
7
  podspecs << (sdk.include?('.podspec') ? sdk : "#{sdk}.podspec")
8
8
  end
9
9
 
10
- if params[:update_version_numbers]
11
- ensure_everything_is_set_up(params)
12
-
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
21
-
22
- ensure_release_tag_is_new(version_number)
23
-
24
- changes = other_action.touch_changelog(
25
- release_version: version_number,
26
- github_repo: params[:github_repo],
27
- changelog_path: params[:changelog_path]
10
+ ensure_everything_is_set_up(params)
11
+
12
+ version_number = ''
13
+ params[:sdk_names].each do |target|
14
+ version_number = other_action.increment_version_number_in_plist(
15
+ target: target,
16
+ version_number: params[:version],
17
+ bump_type: params[:bump_type]
28
18
  )
19
+ end
29
20
 
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
34
-
35
- params[:extra_changes].call(version_number) if params[:extra_changes]
21
+ ensure_release_tag_is_new(version_number)
36
22
 
37
- sh("git checkout -b release/#{version_number}") if params[:create_pull_request]
23
+ changes = other_action.touch_changelog(
24
+ release_version: version_number,
25
+ github_repo: params[:github_repo],
26
+ changelog_path: params[:changelog_path]
27
+ )
38
28
 
39
- commit_changes(version_number)
29
+ podspecs.each do |podspec|
30
+ UI.user_error!("Podspec #{podspec} does not exist!") unless File.exist?(podspec)
31
+ other_action.version_bump_podspec(path: podspec, version_number: version_number)
40
32
  end
41
33
 
34
+ params[:extra_changes].call(version_number) if params[:extra_changes]
35
+
36
+ sh("git checkout -b release/#{version_number}") if params[:create_pull_request]
37
+
38
+ commit_changes(version_number)
39
+
42
40
  if params[:create_pull_request]
43
41
  create_pull_request(
44
42
  api_token: params[:github_token],
@@ -48,40 +46,15 @@ module Fastlane
48
46
  base: 'main',
49
47
  body: changes.to_s
50
48
  )
51
- UI.success("Successfully started release #{version_number}! 🚢")
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(
59
- version: version_number,
60
- changelog_path: params[:changelog_path]
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! 🚢")
76
49
  end
50
+
51
+ UI.success("Successfully started release #{version_number}! 🚢")
52
+ version_number
77
53
  end
78
54
 
79
55
  def self.ensure_everything_is_set_up(params)
80
- other_action.ensure_git_branch(branch: 'main') if params[:publish_release]
81
56
  other_action.ensure_git_status_clean unless params[:skip_git_status_check]
82
57
 
83
- UI.user_error!('Please set GITHUB_TOKEN environment value.') if params[:github_token].nil?
84
-
85
58
  if params[:version].nil? && !["patch", "minor", "major"].include?(params[:bump_type])
86
59
  UI.user_error!("Please use type parameter with one of the options: type:patch, type:minor, type:major")
87
60
  end
@@ -173,24 +146,6 @@ module Fastlane
173
146
  description: 'Create pull request from release branch to main',
174
147
  is_string: false,
175
148
  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
194
149
  )
195
150
  ]
196
151
  end
@@ -6,7 +6,11 @@ module Fastlane
6
6
  app_identifier: params[:app_identifier],
7
7
  api_key: params[:api_key]
8
8
  ) + 1
9
- other_action.increment_build_number_in_plist(build_number: build_number.to_s, target: params[:app_target])
9
+
10
+ targets = params[:extensions] << params[:app_target]
11
+ targets.each do |target|
12
+ other_action.increment_build_number_in_plist(build_number: build_number.to_s, target: target)
13
+ end
10
14
 
11
15
  other_action.gym(
12
16
  project: params[:xcode_project],
@@ -92,6 +96,12 @@ module Fastlane
92
96
  UI.user_error!('DemoApp target name has to be specified') if target.nil? || target.empty?
93
97
  end
94
98
  ),
99
+ FastlaneCore::ConfigItem.new(
100
+ key: :extensions,
101
+ description: 'Extensions/dependencies target names to bump build number',
102
+ is_string: false,
103
+ default_value: []
104
+ ),
95
105
  FastlaneCore::ConfigItem.new(
96
106
  key: :app_identifier,
97
107
  description: 'DemoApp bundle identifier',
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = '0.3.3'
3
+ VERSION = '0.3.5'
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.3
4
+ version: 0.3.5
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-19 00:00:00.000000000 Z
11
+ date: 2023-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -236,6 +236,7 @@ files:
236
236
  - lib/fastlane/plugin/stream_actions/actions/is_check_required.rb
237
237
  - lib/fastlane/plugin/stream_actions/actions/pod_push_safely.rb
238
238
  - lib/fastlane/plugin/stream_actions/actions/prepare_simulator.rb
239
+ - lib/fastlane/plugin/stream_actions/actions/publish_ios_sdk.rb
239
240
  - lib/fastlane/plugin/stream_actions/actions/read_changelog.rb
240
241
  - lib/fastlane/plugin/stream_actions/actions/release_ios_sdk.rb
241
242
  - lib/fastlane/plugin/stream_actions/actions/retrieve_xctest_names.rb