|
9 | 9 | exit(1) |
10 | 10 | end |
11 | 11 |
|
12 | | -$CIRRUS_RELEASE = ENV['CIRRUS_RELEASE'] || '' |
13 | | -if $CIRRUS_RELEASE.empty? |
| 12 | +$CIRRUS_TAG = ENV['CIRRUS_TAG'] || '' |
| 13 | +if $CIRRUS_TAG.empty? |
14 | 14 | uri = URI('https://api.github.com/repos/mcorino/wxruby3/releases/latest') |
15 | 15 | headers = { |
16 | 16 | 'Accept' => 'application/vnd.github+json', |
|
26 | 26 | end |
27 | 27 | if rest_response.code.to_i == 200 |
28 | 28 | data = JSON.parse!(rest_response.body) |
29 | | - $CIRRUS_RELEASE = data['id'] |
| 29 | + $CIRRUS_TAG = data['id'] |
30 | 30 | else |
31 | 31 | $stderr.puts "Cannot determine latest release [#{rest_response}]!" |
32 | 32 | exit(1) |
|
36 | 36 | file_content_type="application/octet-stream" |
37 | 37 | Dir.glob(File.join('pkg', '*.pkg')).each do |fpath| |
38 | 38 | name = File.basename(fpath) |
39 | | - url_to_upload = "https://uploads.github.com/repos/mcorino/wxruby3/releases/#{$CIRRUS_RELEASE}/assets?name=#{name}" |
40 | | - puts "Uploading #{fpath} for release #{$CIRRUS_RELEASE} to #{url_to_upload}..." |
| 39 | + url_to_upload = "https://uploads.github.com/repos/mcorino/wxruby3/releases/#{$CIRRUS_TAG}/assets?name=#{name}" |
| 40 | + puts "Uploading #{fpath} for release #{$CIRRUS_TAG} to #{url_to_upload}..." |
41 | 41 | cmd = "curl -L -X POST -H \"Accept: application/vnd.github+json\" " + |
42 | 42 | "-H \"Authorization: token #{$GITHUB_TOKEN}\" " + |
43 | 43 | "-H \"X-GitHub-Api-Version: 2022-11-28\" " + |
|
48 | 48 | if rc |
49 | 49 | name = File.basename(name, '.*')+'.sha' |
50 | 50 | fpath = File.join(File.dirname(fpath), name) |
51 | | - url_to_upload = "https://uploads.github.com/repos/mcorino/wxruby3/releases/#{$CIRRUS_RELEASE}/assets?name=#{name}" |
52 | | - puts "Uploading #{fpath} for release #{$CIRRUS_RELEASE} to #{url_to_upload}..." |
| 51 | + url_to_upload = "https://uploads.github.com/repos/mcorino/wxruby3/releases/#{$CIRRUS_TAG}/assets?name=#{name}" |
| 52 | + puts "Uploading #{fpath} for release #{$CIRRUS_TAG} to #{url_to_upload}..." |
53 | 53 | cmd = "curl -L -X POST -H \"Accept: application/vnd.github+json\" " + |
54 | 54 | "-H \"Authorization: token #{$GITHUB_TOKEN}\" " + |
55 | 55 | "-H \"X-GitHub-Api-Version: 2022-11-28\" " + |
|
0 commit comments