fastlane-plugin-stream_actions 0.2.7 → 0.3.1

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: ce8fcaa508362a2c52b5e9c5afc5a1c8263a48701087170ea67eec8a33484059
4
- data.tar.gz: c8e53e7fd466393bd091116485c7ab3e4221df602a311b76289d46aa69d65dda
3
+ metadata.gz: 3ce9c877edbbeedd2f1b8964f799c5a46187ae5eface42c07a5134420d17c218
4
+ data.tar.gz: c37c1692a84c4035f1f53203fe21b8a98e159890b57df75816a97afcbc202cc5
5
5
  SHA512:
6
- metadata.gz: bb27ade0c8c605bfab2eafa935553a1499928e0cd440b5ed0c87440a4a769711fe4499b57d3f11e7a108b75370f8717923713db77a68d721860354ede06c4670
7
- data.tar.gz: 14b94ac5bfa62d79e8c3bbab4d87feda48aafdc4a5f102dcd3eb2e7c58c582ebd90df6b4f92692b32da43f06f08dc61cca9ec9c390140405787516a0fa382c29
6
+ metadata.gz: 4c14cde70127520818a7788e1e050ce332b0a3398d46d29e08db1d288fc8d3225272fd09b7fe69f7d66c839959897e48bdbe9a4efffead749f8a1f22e33c5557
7
+ data.tar.gz: f18254f28271bfe4c1dbeaae7d1835579dc79f572fb0f2eac9f72b29bf05f7162fe49ece3ba3274cc78af898d33ea732d63f1cbb2d4ba6127716467e0bb5b284
@@ -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
@@ -0,0 +1,109 @@
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
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = "0.2.7"
3
+ VERSION = '0.3.1'
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.7
4
+ version: 0.3.1
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