Merge pull request #13420 from Bo98/multi-os-dispatch

dev-cmd/dispatch-build-bottle: remove --macos and --linux conflict
This commit is contained in:
Bo Anderson 2022-06-16 13:45:53 +01:00 committed by GitHub
commit bc4f15faa4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 12 deletions

View File

@ -34,7 +34,7 @@ module Homebrew
switch "--linux-wheezy", switch "--linux-wheezy",
description: "Use Debian Wheezy container for building the bottle on Linux." description: "Use Debian Wheezy container for building the bottle on Linux."
conflicts "--macos", "--linux", "--linux-self-hosted" conflicts "--linux", "--linux-self-hosted"
named_args :formula, min: 1 named_args :formula, min: 1
end end
end end
@ -47,8 +47,10 @@ module Homebrew
ref = "master" ref = "master"
workflow = args.workflow || "dispatch-build-bottle.yml" workflow = args.workflow || "dispatch-build-bottle.yml"
runners = if (macos = args.macos&.compact_blank) && macos.present? runners = []
macos.map do |element|
if (macos = args.macos&.compact_blank) && macos.present?
runners += macos.map do |element|
# We accept runner name syntax (11-arm64) or bottle syntax (arm64_big_sur) # We accept runner name syntax (11-arm64) or bottle syntax (arm64_big_sur)
os, arch = element.yield_self do |s| os, arch = element.yield_self do |s|
tag = Utils::Bottles::Tag.from_symbol(s.to_sym) tag = Utils::Bottles::Tag.from_symbol(s.to_sym)
@ -64,14 +66,16 @@ module Homebrew
os.to_s os.to_s
end end
end end
elsif args.linux?
["ubuntu-latest"]
elsif args.linux_self_hosted?
["linux-self-hosted-1"]
else
raise UsageError, "Must specify --macos or --linux or --linux-self-hosted option"
end end
if args.linux?
runners << "ubuntu-latest"
elsif args.linux_self_hosted?
runners << "linux-self-hosted-1"
end
raise UsageError, "Must specify --macos or --linux or --linux-self-hosted option" if runners.empty?
args.named.to_resolved_formulae.each do |formula| args.named.to_resolved_formulae.each do |formula|
# Required inputs # Required inputs
inputs = { inputs = {

View File

@ -744,10 +744,10 @@ _brew_dispatch_build_bottle() {
'--debug[Display any debugging information]' \ '--debug[Display any debugging information]' \
'--help[Show this message]' \ '--help[Show this message]' \
'--issue[If specified, post a comment to this issue number if the job fails]' \ '--issue[If specified, post a comment to this issue number if the job fails]' \
'(--macos --linux-self-hosted)--linux[Dispatch bottle for Linux (using GitHub runners)]' \ '(--linux-self-hosted)--linux[Dispatch bottle for Linux (using GitHub runners)]' \
'(--macos --linux)--linux-self-hosted[Dispatch bottle for Linux (using self-hosted runner)]' \ '(--linux)--linux-self-hosted[Dispatch bottle for Linux (using self-hosted runner)]' \
'--linux-wheezy[Use Debian Wheezy container for building the bottle on Linux]' \ '--linux-wheezy[Use Debian Wheezy container for building the bottle on Linux]' \
'(--linux --linux-self-hosted)--macos[Version(s) of macOS the bottle should be built for]' \ '--macos[Version(s) of macOS the bottle should be built for]' \
'--quiet[Make some output more quiet]' \ '--quiet[Make some output more quiet]' \
'--tap[Target tap repository (default: `homebrew/core`)]' \ '--tap[Target tap repository (default: `homebrew/core`)]' \
'--timeout[Build timeout (in minutes, default: 60)]' \ '--timeout[Build timeout (in minutes, default: 60)]' \