Skip to content

Commit c1a3b47

Browse files
committed
Fail upload task if it can't find files to upload and fix for Windows
If we can't find files to upload, then the task should fail, especially in GitHub Actions. This also fixes pathing on Windows in a way that should work for both local and CI Cygwin-based builds.
1 parent d5bf5a3 commit c1a3b47

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

tasks/upload.rake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ namespace :vox do
1616
# Ensure the AWS CLI isn't going to fail with the given parameters
1717
run_command("#{s3} ls s3://#{bucket}/")
1818

19-
prepend = File.directory?('/cygdrive/') ? 'C:/cygwin64/' : ''
20-
files = Dir.glob("#{prepend}#{__dir__}/../output/*#{munged_tag}*#{platform}*")
21-
puts 'No files for the given tag found in the output directory.' if files.empty?
19+
files = Dir.glob("#{__dir__}/../output/*#{munged_tag}*#{platform}*")
20+
abort 'No files for the given tag found in the output directory.' if files.empty?
2221

2322
path = "s3://#{bucket}/#{repo}/#{args[:tag]}"
2423
files.each do |f|
24+
f = `cygpath -m #{f}`.chomp if platform =~ /windows-/
2525
run_command("#{s3} cp #{f} #{path}/#{File.basename(f)}", silent: false)
2626
end
2727
end

0 commit comments

Comments
 (0)