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",
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
end
end
@ -47,8 +47,10 @@ module Homebrew
ref = "master"
workflow = args.workflow || "dispatch-build-bottle.yml"
runners = if (macos = args.macos&.compact_blank) && macos.present?
macos.map do |element|
runners = []
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)
os, arch = element.yield_self do |s|
tag = Utils::Bottles::Tag.from_symbol(s.to_sym)
@ -64,14 +66,16 @@ module Homebrew
os.to_s
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
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|
# Required inputs
inputs = {

View File

@ -744,10 +744,10 @@ _brew_dispatch_build_bottle() {
'--debug[Display any debugging information]' \
'--help[Show this message]' \
'--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)]' \
'(--macos --linux)--linux-self-hosted[Dispatch bottle for Linux (using self-hosted runner)]' \
'(--linux-self-hosted)--linux[Dispatch bottle for Linux (using GitHub runners)]' \
'(--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 --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]' \
'--tap[Target tap repository (default: `homebrew/core`)]' \
'--timeout[Build timeout (in minutes, default: 60)]' \