Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/cli_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: RubyGems Deploy

on:
workflow_dispatch:
release:
types: [ published ]

jobs:
build:
Expand Down
11 changes: 8 additions & 3 deletions lib/commands/upload/snapshots/client_libraries/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ module Commands
module Upload
module ClientLibraries
class Default
def initialize(image_paths)
def initialize(image_paths, group_delimiter)
@image_paths = image_paths
@group_delimiter = group_delimiter
end

def image_files
Expand All @@ -13,10 +14,14 @@ def image_files

def parse_file_info(image_path)
file_name = File.basename(image_path)
file_name_without_extension = File.basename(file_name, '.*')
parts = file_name_without_extension.split(@group_delimiter)
group_name = parts.first
variant_name = parts[1..].join(@group_delimiter)
{
file_name:,
group_name: File.basename(image_path, '.*'),
variant_name: nil
group_name:,
variant_name:
}
end
end
Expand Down
7 changes: 4 additions & 3 deletions lib/commands/upload/snapshots/snapshots.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class Snapshots < EmergeCLI::Commands::GlobalOptions
option :base_sha, type: :string, required: false, desc: 'Base SHA'
option :previous_sha, type: :string, required: false, desc: 'Previous SHA'
option :pr_number, type: :string, required: false, desc: 'PR number'
option :concurrency, type: :integer, default: 5, desc: 'Number of concurrency for parallel uploads'
option :concurrency, type: :integer, default: 5,
desc: 'Number of concurrency for parallel image uploads when not using batch mode'

option :client_library, type: :string, required: false, values: %w[swift-snapshot-testing paparazzi roborazzi],
desc: 'Client library used for snapshots'
Expand All @@ -36,7 +37,7 @@ class Snapshots < EmergeCLI::Commands::GlobalOptions
option :profile, type: :boolean, default: false, desc: 'Enable performance profiling metrics'

option :batch, type: :boolean, default: true, desc: 'Upload images in batch using zip file'

option :group_delimiter, type: :string, default: '__', desc: 'Delimiter for group and variant names'
argument :image_paths, type: :array, required: false, desc: 'Paths to folders containing images'

def initialize(network: nil, git_info_provider: nil)
Expand Down Expand Up @@ -119,7 +120,7 @@ def create_client(image_paths)
raise "Unsupported client library: #{@options[:client_library]}"
end
else
ClientLibraries::Default.new(image_paths)
ClientLibraries::Default.new(image_paths, @options[:group_delimiter])
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module EmergeCLI
VERSION = '0.7.4'.freeze
VERSION = '0.7.5'.freeze
end
Loading