fastlane-plugin-stream_actions 0.3.63 → 0.3.64

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: d3058e337109a1d70cf0df36ebecbc711edc31fb912babb9256ceb6d2e104101
4
- data.tar.gz: 8821234fa7633ebfd74feae8250a17e521a1053b6661d2c7c2c3a34295332d5f
3
+ metadata.gz: 4f7e2e6f8048ba0bfb6944452f9294c20475731a9166ae03b757272ab9640bf0
4
+ data.tar.gz: e10447271ffa41fac67036418a2366c2f566c9b148dded883b9e12a70007bcdc
5
5
  SHA512:
6
- metadata.gz: aeeccba7bfd43453f728160290c47ad9477bfb4a3a20dd9a695e2d6ccf958d67d6fc21a6dedb003099fcca59a2a9a8b399e149710d8ffb53f17e59bbf82a8039
7
- data.tar.gz: dba5eb0169b3f309ce7d05ccc376955dad5aee8b35b0bff8b0dc0be2451e4e25047bc503924a8aaacdae7e02c484efe1472405bda82aa31c8c09b4958b0c311a
6
+ metadata.gz: 18f64942f0c3ad3f4167b9566548cadb6a1ec672821dec84555a8b76f6dfe3af7fd4a8f2571a5a46104e382fe7fe5f5fb0d9ebcfa8acfef54b3f12307cf8b28b
7
+ data.tar.gz: aa592d22f547488a9b8b510769a3b269403f6d56f79dfd068015a7b864103d51b21c49dc014567a87084e5025bb25d1c2199e61757ef267f0ad6636b9f7b49fb
@@ -20,12 +20,17 @@ module Fastlane
20
20
  markdown_table = "#{table_header}\n| `title` | `#{is_release ? 'previous release' : 'develop'}` | `#{is_release ? 'current release' : 'branch'}` | `diff` | `status` |\n| - | - | - | - | - |\n"
21
21
  params[:branch_sizes].each do |sdk_name, branch_value_kb|
22
22
  branch_value_mb = (branch_value_kb / 1024.0).round(2)
23
+ branch_value = params[:size_ext] == 'KB' ? branch_value_kb : branch_value_mb
23
24
  benchmark_value_kb = benchmark_sizes[sdk_name.to_s]
24
25
  benchmark_value_mb = (benchmark_value_kb / 1024.0).round(2)
26
+ benchmark_value = params[:size_ext] == 'KB' ? benchmark_value_kb : benchmark_value_mb
25
27
  max_tolerance = 500 # Max Tolerance is 500KB
26
28
  fine_tolerance = 250 # Fine Tolerance is 250KB
27
29
 
28
- diff = (branch_value_kb - benchmark_value_kb).round(0)
30
+ diff_kb = (branch_value_kb - benchmark_value_kb).round(0)
31
+ 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'
29
34
 
30
35
  diff_sign = if diff.zero?
31
36
  ''
@@ -45,7 +50,7 @@ module Fastlane
45
50
  success_status
46
51
  end
47
52
 
48
- markdown_table << "|#{sdk_name}|#{benchmark_value_mb} MB|#{branch_value_mb} MB|#{diff_sign}#{diff.abs} KB|#{status_emoji}|\n"
53
+ markdown_table << "|#{sdk_name}|#{benchmark_value} #{params[:size_ext]}|#{branch_value} #{params[:size_ext]}|#{diff_sign}#{diff.abs} #{diff_ext}|#{status_emoji}|\n"
49
54
  end
50
55
 
51
56
  FastlaneCore::PrintTable.print_values(title: 'Benchmark', config: benchmark_sizes)
@@ -97,6 +102,11 @@ module Fastlane
97
102
  verify_block: proc do |s|
98
103
  UI.user_error!("Branch sizes have to be specified") if s.nil?
99
104
  end
105
+ ),
106
+ FastlaneCore::ConfigItem.new(
107
+ key: :size_ext,
108
+ description: 'SDK size extension (KB or MB)',
109
+ default_value: 'MB'
100
110
  )
101
111
  ]
102
112
  end
@@ -7,7 +7,8 @@ module Fastlane
7
7
  params[:sizes].each do |key, value|
8
8
  framework_size_kb = value
9
9
  framework_size_mb = (framework_size_kb / 1024.0).round(2)
10
- readme_content.gsub!(%r{(https://img.shields.io/badge/#{key}-)(.*?)(-blue)}, "\\1#{framework_size_mb}%20MB\\3")
10
+ framework_size = params[:size_ext] == 'KB' ? framework_size_kb : framework_size_mb
11
+ readme_content.gsub!(%r{(https://img.shields.io/badge/#{key}-)(.*?)(-blue)}, "\\1#{framework_size}%20#{params[:size_ext]}\\3")
11
12
  end
12
13
 
13
14
  File.write(params[:readme_path], readme_content)
@@ -42,6 +43,11 @@ module Fastlane
42
43
  key: :open_pr,
43
44
  description: 'Should a PR be opened',
44
45
  is_string: false
46
+ ),
47
+ FastlaneCore::ConfigItem.new(
48
+ key: :size_ext,
49
+ description: 'SDK size extension (KB or MB)',
50
+ default_value: 'MB'
45
51
  )
46
52
  ]
47
53
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module StreamActions
3
- VERSION = '0.3.63'
3
+ VERSION = '0.3.64'
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.63
4
+ version: 0.3.64
5
5
  platform: ruby
6
6
  authors:
7
7
  - GetStream
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-16 00:00:00.000000000 Z
11
+ date: 2024-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xctest_list