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
|
||||
current_version = Helper.detect_version
|
||||
Helper.wait_github_actions_workflow(current_version, "release.yaml")
|
||||
exit
|
||||
ruby("-C",
|
||||
"packages",
|
||||
"-S",
|
||||
|
||||
11
helper.rb
11
helper.rb
@ -58,13 +58,22 @@ module Helper
|
||||
end
|
||||
|
||||
def wait_github_actions_workflow(branch, workflow_file)
|
||||
run_id = nil
|
||||
|
||||
3.times do
|
||||
response = call_github_api("repos/#{github_repository}/actions/runs",
|
||||
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_request_path = "repos/#{github_repository}/actions/runs/#{run_id}"
|
||||
loop do
|
||||
response = call_github_api(run_request_path)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user