fastlane-plugin-stream_actions 0.3.67 → 0.3.69

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: 195738840bfa8ef93bd7341f13117f152343806ce2d2f522c978b4ec89131c5a
4
- data.tar.gz: f82a547e295676312c91b5b9606be98900ed715eb5eee467323cb6dc46295e9c
3
+ metadata.gz: fbb3267b8d16255b92319bcc134c6b2df4504f05f3ab25727f3e94f5b2010c16
4
+ data.tar.gz: 46ec7033ddcd83ee4af2387f4ed0ec8e53ba6b2afedcd189eb1819a5d5f5a98e
5
5
  SHA512:
6
- metadata.gz: 491259c4dede5907a6b31e4db56a053aaa3b0746d4b95fb4fe35fa71250b240cbd217896e11b35fafa585c4128ea55fea1ece5aa49838e515bb4e0a85db3d573
7
- data.tar.gz: aa1b545707330ae0a59fef04e006126b0a3dfe8d198aa77236ea92757ad4eac395c1a9ccc25af9fd17bc0446377b147a8931adc65d5ad659fae7cc0fb5b5e4ab
6
+ metadata.gz: f21984a3644a170c88350dc0c421a607bae36529d0b06070c9c5a898b515664a5849d37020244d06d218cbc166f3629e229317a52744cc13ad31dc73eb6d687a
7
+ data.tar.gz: bb1024f32e1cab981ebc9c1bf3fa74188a30247a425332a2ebbf831eef2c4dce5a7cab71332fe1ec5317623249d6a758db4a8a2b325210050aa316a6da6ce608
@@ -5,17 +5,23 @@ module Fastlane
5
5
  sh("git checkout -b #{params[:head_branch]}")
6
6
  sh('git restore Brewfile.lock.json || true')
7
7
  sh("git add #{params[:git_add]}")
8
- sh("git commit -m '#{params[:title]}'")
9
- other_action.push_to_git_remote(tags: false)
8
+ staged_files = sh('git diff --cached --name-only').split
9
+ if staged_files.empty?
10
+ unstaged_files = sh('git diff --name-only')
11
+ UI.important("There is nothing to commit. See unstaged files for more details:\n#{unstaged_files}")
12
+ else
13
+ sh("git commit -m '#{params[:title]}'")
14
+ other_action.push_to_git_remote(tags: false)
10
15
 
11
- other_action.create_pull_request(
12
- api_token: ENV.fetch('GITHUB_TOKEN'),
13
- repo: params[:github_repo],
14
- title: params[:title],
15
- head: params[:head_branch],
16
- base: params[:base_branch],
17
- body: 'This PR was created automatically by CI.'
18
- )
16
+ other_action.create_pull_request(
17
+ api_token: ENV.fetch('GITHUB_TOKEN'),
18
+ repo: params[:github_repo],
19
+ title: params[:title],
20
+ head: params[:head_branch],
21
+ base: params[:base_branch],
22
+ body: 'This PR was created automatically by CI.'
23
+ )
24
+ end
19
25
  end
20
26
 
21
27
  #####################################################
@@ -15,22 +15,23 @@ module Fastlane
15
15
  benchmark_config = JSON.parse(File.read(sdk_size_path))
16
16
  benchmark_key = is_release ? 'release' : 'develop'
17
17
  benchmark_sizes = benchmark_config[benchmark_key]
18
+ is_kb = params[:size_ext] == 'KB'
18
19
 
19
20
  table_header = '## SDK Size'
20
21
  markdown_table = "#{table_header}\n| `title` | `#{is_release ? 'previous release' : 'develop'}` | `#{is_release ? 'current release' : 'branch'}` | `diff` | `status` |\n| - | - | - | - | - |\n"
21
22
  params[:branch_sizes].each do |sdk_name, branch_value_kb|
22
23
  branch_value_mb = (branch_value_kb / 1024.0).round(2)
23
- branch_value = params[:size_ext] == 'KB' ? branch_value_kb.round(0) : branch_value_mb
24
+ branch_value = is_kb ? branch_value_kb.round(0) : branch_value_mb
24
25
  benchmark_value_kb = benchmark_sizes[sdk_name.to_s]
25
26
  benchmark_value_mb = (benchmark_value_kb / 1024.0).round(2)
26
- benchmark_value = params[:size_ext] == 'KB' ? benchmark_value_kb : benchmark_value_mb
27
- max_tolerance = 500 # Max Tolerance is 500KB
28
- fine_tolerance = 250 # Fine Tolerance is 250KB
27
+ benchmark_value = is_kb ? benchmark_value_kb : benchmark_value_mb
28
+ max_tolerance = params[:max_tolerance] || is_kb ? 500 : 5000 # By default, Max Tolerance is 500 Kilobytes or 5000 Bytes
29
+ fine_tolerance = params[:fine_tolerance] || is_kb ? 250 : 2500 # By default, Fine Tolerance is 250 Kilobytes or 2500 Bytes
29
30
 
30
31
  diff_kb = (branch_value_kb - benchmark_value_kb).round(0)
31
32
  diff_b = ((branch_value_kb - benchmark_value_kb) * 1024).round(0)
32
- diff = params[:size_ext] == 'KB' ? diff_b : diff_kb
33
- diff_ext = params[:size_ext] == 'KB' ? 'B' : 'KB'
33
+ diff = is_kb ? diff_b : diff_kb
34
+ diff_ext = is_kb ? 'B' : 'KB'
34
35
 
35
36
  diff_sign = if diff.zero?
36
37
  ''
@@ -107,6 +108,18 @@ module Fastlane
107
108
  key: :size_ext,
108
109
  description: 'SDK size extension (KB or MB)',
109
110
  default_value: 'MB'
111
+ ),
112
+ FastlaneCore::ConfigItem.new(
113
+ key: :max_tolerance,
114
+ description: 'Max tolerance (in KB `if size_ext == MB` or in B `if size_ext == KB`)',
115
+ is_string: false,
116
+ optional: true
117
+ ),
118
+ FastlaneCore::ConfigItem.new(
119
+ key: :fine_tolerance,
120
+ description: 'Fine tolerance (in KB `if size_ext == MB` or in B `if size_ext == KB`)',
121
+ is_string: false,
122
+ optional: true
110
123
  )
111
124
  ]
112
125
  end
@@ -17,7 +17,7 @@ module Fastlane
17
17
  if params[:open_pr]
18
18
  other_action.pr_create(
19
19
  title: params[:pr_title],
20
- git_add: 'README.md',
20
+ git_add: params[:readme_path],
21
21
  head_branch: "ci/sdk-size-update-#{Time.now.to_i}"
22
22
  )
23
23
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = '0.3.67'
3
+ VERSION = '0.3.69'
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.67
4
+ version: 0.3.69
5
5
  platform: ruby
6
6
  authors:
7
7
  - GetStream
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-06 00:00:00.000000000 Z
11
+ date: 2024-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xctest_list