Make release process more robust (#51)
* Remove debug `exit` * Add support for retrying in the target workflow detection
This commit is contained in:
parent
79a47dcb2f
commit
7c5afabd20
1
Rakefile
1
Rakefile
@ -104,7 +104,6 @@ namespace :release do
|
|||||||
task :ubuntu do
|
task :ubuntu do
|
||||||
current_version = Helper.detect_version
|
current_version = Helper.detect_version
|
||||||
Helper.wait_github_actions_workflow(current_version, "release.yaml")
|
Helper.wait_github_actions_workflow(current_version, "release.yaml")
|
||||||
exit
|
|
||||||
ruby("-C",
|
ruby("-C",
|
||||||
"packages",
|
"packages",
|
||||||
"-S",
|
"-S",
|
||||||
|
|||||||
21
helper.rb
21
helper.rb
@ -58,13 +58,22 @@ module Helper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def wait_github_actions_workflow(branch, workflow_file)
|
def wait_github_actions_workflow(branch, workflow_file)
|
||||||
response = call_github_api("repos/#{github_repository}/actions/runs",
|
run_id = nil
|
||||||
branch: branch)
|
|
||||||
run = response["workflow_runs"].find do |workflow_run|
|
3.times do
|
||||||
workflow_run["path"] == ".github/workflows/#{workflow_file}"
|
response = call_github_api("repos/#{github_repository}/actions/runs",
|
||||||
end
|
branch: branch)
|
||||||
|
run = response["workflow_runs"].find do |workflow_run|
|
||||||
|
workflow_run["path"] == ".github/workflows/#{workflow_file}"
|
||||||
|
end
|
||||||
|
if run
|
||||||
|
run_id = run["id"]
|
||||||
|
break
|
||||||
|
end
|
||||||
|
sleep(60)
|
||||||
|
end
|
||||||
|
raise "Couldn't find target workflow" if run_id.nil?
|
||||||
|
|
||||||
run_id = run["id"]
|
|
||||||
run_request_path = "repos/#{github_repository}/actions/runs/#{run_id}"
|
run_request_path = "repos/#{github_repository}/actions/runs/#{run_id}"
|
||||||
loop do
|
loop do
|
||||||
response = call_github_api(run_request_path)
|
response = call_github_api(run_request_path)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user