Skip to content

Commit 77398ce

Browse files
authored
Merge pull request #403 from mcorino/develop
fix automatic Cirrus release builds
2 parents 71911bf + 92e0732 commit 77398ce

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

tools/scripts/cirrus/cirrus-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
env:
55
WXRUBY_TEST_EXCLUDE: 'test_intl:test_media_ctrl'
66
GITHUB_TOKEN: ENCRYPTED[!d9f8c8d7b73dd043f3d5f287caaedad4530509c511cfb4aaf9e4582b2f6b4e3962fea59108f1dc396774e7887452fa85!]
7+
CIRRUS_TAG: '#{GH_RELEASE_TAG}'
78

89
release_task:
910
timeout_in: 90m

tools/scripts/cirrus/start_release_tasks.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
$release = false # actual release or manual test run
1010
$refname = 'master'
11-
$task_cfg = File.join(__dir__, 'cirrus-release.yml')
11+
$task_cfg = File.read(File.join(__dir__, 'cirrus-release.yml'))
1212
until ARGV.empty?
1313
arg = ARGV.shift
1414
case arg
@@ -21,6 +21,8 @@
2121
end
2222
end
2323

24+
$task_cfg.sub('#{GH_RELEASE_TAG}', $refname)
25+
2426
# for an actual release use the master branch and get the actual sha for the release tag
2527
if $release
2628
$branch = 'master'
@@ -47,7 +49,7 @@
4749
input: {
4850
repositoryId: "#{$repository_id}",
4951
branch: $branch,
50-
configOverride: File.read($task_cfg),
52+
configOverride: $task_cfg,
5153
clientMutationId: "wxRuby3"
5254
}
5355
}

tools/scripts/cirrus/test-wxruby3-release.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ if [ "$CIRRUS_TAG" == "" ]; then
99
fi
1010
fi
1111

12+
echo "Testing wxRuby3 $CIRRUS_TAG"
13+
1214
gem sources --add "https://mcorino:$GITHUB_TOKEN@rubygems.pkg.github.com/mcorino/"
1315

1416
WXRUBY_VERSION=${CIRRUS_TAG/#v/}

tools/scripts/cirrus/upload-release-pkg.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
exit(1)
1010
end
1111

12-
$CIRRUS_RELEASE = ENV['CIRRUS_RELEASE'] || ''
13-
if $CIRRUS_RELEASE.empty?
12+
$CIRRUS_TAG = ENV['CIRRUS_TAG'] || ''
13+
if $CIRRUS_TAG.empty?
1414
uri = URI('https://api.github.com/repos/mcorino/wxruby3/releases/latest')
1515
headers = {
1616
'Accept' => 'application/vnd.github+json',
@@ -26,7 +26,7 @@
2626
end
2727
if rest_response.code.to_i == 200
2828
data = JSON.parse!(rest_response.body)
29-
$CIRRUS_RELEASE = data['id']
29+
$CIRRUS_TAG = data['id']
3030
else
3131
$stderr.puts "Cannot determine latest release [#{rest_response}]!"
3232
exit(1)
@@ -36,8 +36,8 @@
3636
file_content_type="application/octet-stream"
3737
Dir.glob(File.join('pkg', '*.pkg')).each do |fpath|
3838
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}..."
4141
cmd = "curl -L -X POST -H \"Accept: application/vnd.github+json\" " +
4242
"-H \"Authorization: token #{$GITHUB_TOKEN}\" " +
4343
"-H \"X-GitHub-Api-Version: 2022-11-28\" " +
@@ -48,8 +48,8 @@
4848
if rc
4949
name = File.basename(name, '.*')+'.sha'
5050
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}..."
5353
cmd = "curl -L -X POST -H \"Accept: application/vnd.github+json\" " +
5454
"-H \"Authorization: token #{$GITHUB_TOKEN}\" " +
5555
"-H \"X-GitHub-Api-Version: 2022-11-28\" " +

0 commit comments

Comments
 (0)