Skip to content

Commit

Permalink
Solve React Native issues
Browse files Browse the repository at this point in the history
  • Loading branch information
testableapple committed Sep 6, 2024
1 parent 836311b commit 1ca11d5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
8 changes: 7 additions & 1 deletion lib/fastlane/plugin/stream_actions/actions/pr_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class PrCreateAction < Action
def self.run(params)
sh("git checkout -b #{params[:head_branch]}")
sh('git restore Brewfile.lock.json || true')
sh('git add -A')
sh("git add #{params[:git_add]}")
sh("git commit -m '#{params[:title]}'")
other_action.push_to_git_remote(tags: false)

Expand Down Expand Up @@ -53,6 +53,12 @@ def self.available_options
description: 'Title',
is_string: true,
optional: false
),
FastlaneCore::ConfigItem.new(
key: :git_add,
description: 'Path that should be commited',
is_string: true,
default_value: '-A'
)
]
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@ def self.run(params)
params[:sizes].each do |key, value|
framework_size_kb = value
framework_size_mb = (framework_size_kb / 1024.0).round(2)
framework_size = params[:size_ext] == 'KB' ? framework_size_kb : framework_size_mb
framework_size = params[:size_ext] == 'KB' ? framework_size_kb.round(0) : framework_size_mb
readme_content.gsub!(%r{(https://img.shields.io/badge/#{key}-)(.*?)(-blue)}, "\\1#{framework_size}%20#{params[:size_ext]}\\3")
end

File.write(params[:readme_path], readme_content)
UI.success('Successfully updated the SDK size labels in README.md!')

other_action.pr_create(title: '[CI] Update SDK Size', head_branch: "ci/sdk-size-update-#{Time.now.to_i}") if params[:open_pr]
if params[:open_pr]
other_action.pr_create(
title: params[:pr_title],
git_add: 'README.md',
head_branch: "ci/sdk-size-update-#{Time.now.to_i}"
)
end
end

#####################################################
Expand All @@ -39,15 +45,21 @@ def self.available_options
description: 'SDK sizes',
is_string: false
),
FastlaneCore::ConfigItem.new(
key: :size_ext,
description: 'SDK size extension (KB or MB)',
default_value: 'MB'
),
FastlaneCore::ConfigItem.new(
key: :open_pr,
description: 'Should a PR be opened',
optional: true,
is_string: false
),
FastlaneCore::ConfigItem.new(
key: :size_ext,
description: 'SDK size extension (KB or MB)',
default_value: 'MB'
key: :pr_title,
description: 'PR title',
default_value: '[CI] Update SDK Size'
)
]
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fastlane/plugin/stream_actions/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Fastlane
module StreamActions
VERSION = '0.3.66'
VERSION = '0.3.67'
end
end

0 comments on commit 1ca11d5

Please sign in to comment.