fastlane-plugin-stream_actions 0.2.6 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 376e8f9f27e8dd18aa0270c546c129595159ece0826bcd8bddde69dabb45f1ef
4
- data.tar.gz: 1322c7d10eefdbdd768d85f25fb496095b2ccec0d813242e8807d76e124a2da5
3
+ metadata.gz: 538676956ed7da6188700b401319fcfeb1622a3dc9ac417c280295bb3f8dbfed
4
+ data.tar.gz: be200c10967bcd1c86a27bdda06a4c539c4f46da9d5b7d0eb3799c2194a080f4
5
5
  SHA512:
6
- metadata.gz: a5401b35f330d20f62faa16d8d5cb9de202495c7f0fd3f06efd5645a48bf1b4e132cc4fbc7d20aeecf9ab88dd381a82f67ea05cc0edad44109b410154df11aab
7
- data.tar.gz: 2ee465621d54c09cb6e1b7dd5c37f0429ec2f80e7033d3e0a78c77db3b41fff389dc8238cda2b9f315f9dd74d782766aff99c87c30a7189ae1384cdf8f5acb51
6
+ metadata.gz: c3b4bd225135e80025715aa44c44ab6e718dde065028186c17622fb658e322e30086f627c28d0fbec47a0b9ec598f2e4139d699c45d33e706dd1af7be4b86833
7
+ data.tar.gz: 529c332761b3c6defb5d56323d968e77e889a84833164dcb93bab9b7cbb089fd5d01aa71cfe9eedc6a17264169398dc89281c280691aef6c653c62f272d412d1
@@ -1,6 +1,6 @@
1
1
  module Fastlane
2
2
  module Actions
3
- class ReleaseIosSdkAction < Action
3
+ class IosSdkReleaseAction < Action
4
4
  def self.run(params)
5
5
  ensure_everything_is_set_up(params)
6
6
 
@@ -29,26 +29,39 @@ module Fastlane
29
29
  other_action.version_bump_podspec(path: podspec, version_number: version_number)
30
30
  end
31
31
 
32
- commit_changes(version_number)
33
-
34
- release_details = other_action.set_github_release(
35
- repository_name: params[:github_repo],
36
- api_token: params[:github_token],
37
- name: version_number,
38
- tag_name: version_number,
39
- description: changes,
40
- commitish: ENV['BRANCH_NAME'] || other_action.git_branch
41
- )
32
+ sh("git checkout -b release/#{version_number}") if params[:create_pull_request]
42
33
 
43
- podspecs.each { |podspec| other_action.pod_push_safely(podspec: podspec, sync: params[:pod_sync] & true) }
34
+ commit_changes(version_number)
44
35
 
45
- UI.success("Github release v#{version_number} was created, please visit #{release_details['html_url']} to see it! 🚢")
36
+ if params[:create_pull_request]
37
+ create_pull_request(
38
+ api_token: params[:github_token],
39
+ repo: params[:github_repo],
40
+ title: "#{version_number} Release",
41
+ head: "release/#{version_number}",
42
+ base: 'main',
43
+ body: changes.to_s
44
+ )
45
+ UI.success("Successfully started release #{version_number}! 🚢")
46
+ else
47
+ other_action.publish_ios_sdk_release(
48
+ 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
+ changelog_path: params[:changelog_path]
55
+ )
56
+ end
46
57
  end
47
58
 
48
59
  def self.ensure_everything_is_set_up(params)
49
- other_action.ensure_git_branch(branch: 'main') if params[:check_release_branch]
60
+ other_action.ensure_git_branch(branch: 'develop') if params[:check_branch]
50
61
  other_action.ensure_git_status_clean if params[:check_git_status]
51
62
 
63
+ UI.user_error!('Please set GITHUB_TOKEN environment value.') if ENV['GITHUB_TOKEN'].nil?
64
+
52
65
  if params[:version].nil? && !["patch", "minor", "major"].include?(params[:bump_type])
53
66
  UI.user_error!("Please use type parameter with one of the options: type:patch, type:minor, type:major")
54
67
  end
@@ -69,7 +82,7 @@ module Fastlane
69
82
  sh("git commit -m 'Bump #{version_number}'")
70
83
  UI.user_error!("Not pushing changes") unless other_action.prompt(text: "Will push changes. All looking good?", boolean: true)
71
84
 
72
- other_action.push_to_git_remote(tags: true)
85
+ other_action.push_to_git_remote(tags: false)
73
86
  end
74
87
 
75
88
  #####################################################
@@ -77,7 +90,7 @@ module Fastlane
77
90
  #####################################################
78
91
 
79
92
  def self.description
80
- 'Releases iOS SDKs to GitHub and CocoaPods'
93
+ 'Releases iOS SDKs'
81
94
  end
82
95
 
83
96
  def self.available_options
@@ -117,23 +130,23 @@ module Fastlane
117
130
  default_value: true
118
131
  ),
119
132
  FastlaneCore::ConfigItem.new(
120
- key: :check_release_branch,
121
- description: 'Ensure git branch is main',
133
+ key: :check_branch,
134
+ description: 'Ensure git branch is develop',
122
135
  is_string: false,
123
136
  default_value: true
124
137
  ),
125
- FastlaneCore::ConfigItem.new(
126
- key: :pod_sync,
127
- description: 'If validation depends on other recently pushed pods, synchronize',
128
- is_string: false,
129
- default_value: false
130
- ),
131
138
  FastlaneCore::ConfigItem.new(
132
139
  key: :changelog_path,
133
140
  env_name: 'FL_CHANGELOG_PATH',
134
141
  description: 'The path to your project CHANGELOG.md',
135
142
  is_string: true,
136
143
  default_value: './CHANGELOG.md'
144
+ ),
145
+ FastlaneCore::ConfigItem.new(
146
+ key: :create_pull_request,
147
+ description: 'Create pull request? Otherwise, will release straight away',
148
+ is_string: false,
149
+ default_value: true
137
150
  )
138
151
  ]
139
152
  end
@@ -10,7 +10,7 @@ module Fastlane
10
10
  other_action.pod_push(path: params[:podspec], allow_warnings: true, synchronous: params[:sync])
11
11
  rescue StandardError => e
12
12
  UI.message(e)
13
- if e.include?('Unable to accept duplicate entry')
13
+ if e.message.include?('Unable to accept duplicate entry')
14
14
  UI.message("pod_push passed for #{params[:podspec]} on previous run. Skipping further attempts.")
15
15
  else
16
16
  UI.message("pod_push failed for #{params[:podspec]}. Waiting a minute until retry for trunk to get updated...")
@@ -0,0 +1,110 @@
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
+ github_repo: params[:github_repo],
11
+ changelog_path: params[:changelog_path]
12
+ )
13
+
14
+ podspecs = []
15
+ params[:sdk_names].each { |sdk| podspecs << "#{sdk}.podspec" }
16
+
17
+ release_details = other_action.set_github_release(
18
+ repository_name: params[:github_repo],
19
+ api_token: params[:github_token],
20
+ name: params[:version],
21
+ tag_name: params[:version],
22
+ description: changes,
23
+ commitish: ENV['BRANCH_NAME'] || other_action.git_branch
24
+ )
25
+
26
+ podspecs.each { |podspec| other_action.pod_push_safely(podspec: podspec, sync: params[:pod_sync] & true) }
27
+
28
+ UI.success("Github release v#{params[:version]} was created, please visit #{release_details['html_url']} to see it! 🚢")
29
+ end
30
+
31
+ def self.ensure_everything_is_set_up(params)
32
+ other_action.ensure_git_branch(branch: 'main') if params[:check_branch]
33
+ other_action.ensure_git_status_clean if params[:check_git_status]
34
+ end
35
+
36
+ def self.ensure_release_tag_is_new(version_number)
37
+ if other_action.git_tag_exists(tag: version_number)
38
+ UI.user_error!("Tag for version #{version_number} already exists!")
39
+ else
40
+ UI.success("Ignore the red warning above. Tag for version #{version_number} is alright!")
41
+ end
42
+ end
43
+
44
+ #####################################################
45
+ # @!group Documentation
46
+ #####################################################
47
+
48
+ def self.description
49
+ 'Publishes iOS SDKs to GitHub and CocoaPods'
50
+ end
51
+
52
+ def self.available_options
53
+ [
54
+ FastlaneCore::ConfigItem.new(
55
+ key: :version,
56
+ description: 'Release version',
57
+ optional: true
58
+ ),
59
+ FastlaneCore::ConfigItem.new(
60
+ key: :sdk_names,
61
+ description: 'SDK names to release',
62
+ is_string: false,
63
+ verify_block: proc do |sdks|
64
+ UI.user_error!("SDK names array has to be specified") unless sdks.kind_of?(Array) && sdks.size.positive?
65
+ end
66
+ ),
67
+ FastlaneCore::ConfigItem.new(
68
+ env_name: 'GITHUB_REPOSITORY',
69
+ key: :github_repo,
70
+ description: 'Github repository name'
71
+ ),
72
+ FastlaneCore::ConfigItem.new(
73
+ env_name: 'GITHUB_TOKEN',
74
+ key: :github_token,
75
+ description: 'GITHUB_TOKEN environment variable'
76
+ ),
77
+ FastlaneCore::ConfigItem.new(
78
+ key: :check_git_status,
79
+ description: 'Ensure git status is clean',
80
+ is_string: false,
81
+ default_value: true
82
+ ),
83
+ FastlaneCore::ConfigItem.new(
84
+ key: :check_branch,
85
+ description: 'Ensure git branch is main',
86
+ is_string: false,
87
+ default_value: true
88
+ ),
89
+ FastlaneCore::ConfigItem.new(
90
+ key: :pod_sync,
91
+ description: 'If validation depends on other recently pushed pods, synchronize',
92
+ is_string: false,
93
+ default_value: false
94
+ ),
95
+ FastlaneCore::ConfigItem.new(
96
+ key: :changelog_path,
97
+ env_name: 'FL_CHANGELOG_PATH',
98
+ description: 'The path to your project CHANGELOG.md',
99
+ is_string: true,
100
+ default_value: './CHANGELOG.md'
101
+ )
102
+ ]
103
+ end
104
+
105
+ def self.supported?(_platform)
106
+ [:ios].include?(platform)
107
+ end
108
+ end
109
+ end
110
+ end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = "0.2.6"
3
+ VERSION = '0.3.0'
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.2.6
4
+ version: 0.3.0
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-17 00:00:00.000000000 Z
11
+ date: 2023-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -233,11 +233,12 @@ 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
236
237
  - lib/fastlane/plugin/stream_actions/actions/is_check_required.rb
237
238
  - lib/fastlane/plugin/stream_actions/actions/pod_push_safely.rb
238
239
  - lib/fastlane/plugin/stream_actions/actions/prepare_simulator.rb
240
+ - lib/fastlane/plugin/stream_actions/actions/publish_ios_sdk_release.rb
239
241
  - lib/fastlane/plugin/stream_actions/actions/read_changelog.rb
240
- - lib/fastlane/plugin/stream_actions/actions/release_ios_sdk.rb
241
242
  - lib/fastlane/plugin/stream_actions/actions/retrieve_xctest_names.rb
242
243
  - lib/fastlane/plugin/stream_actions/actions/testflight_build.rb
243
244
  - lib/fastlane/plugin/stream_actions/actions/touch_changelog.rb