Make release process more robust (#51)

* Remove debug `exit`
* Add support for retrying in the target workflow detection
This commit is contained in:
Sutou Kouhei 2025-10-10 16:23:00 +09:00 committed by GitHub
parent 79a47dcb2f
commit 7c5afabd20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 7 deletions

View File

@ -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",

View File

@ -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)