Merge pull request #12457 from FnControlOption/pr-upload

pr-upload: deprecate `--github-org=`
This commit is contained in:
Mike McQuaid 2021-11-22 12:26:23 +00:00 committed by GitHub
commit ef4e329ce4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 18 deletions

View File

@ -30,8 +30,7 @@ module Homebrew
description: "Skip running `brew bottle` before uploading." description: "Skip running `brew bottle` before uploading."
flag "--committer=", flag "--committer=",
description: "Specify a committer name and email in `git`'s standard author format." description: "Specify a committer name and email in `git`'s standard author format."
flag "--github-org=", flag "--github-org=", hidden: true
description: "Upload to the specified GitHub organisation's GitHub Packages (default: `homebrew`)."
flag "--root-url=", flag "--root-url=",
description: "Use the specified <URL> as the root of the bottle's URL instead of Homebrew's default." description: "Use the specified <URL> as the root of the bottle's URL instead of Homebrew's default."
flag "--root-url-using=", flag "--root-url-using=",
@ -91,6 +90,8 @@ module Homebrew
def pr_upload def pr_upload
args = pr_upload_args.parse args = pr_upload_args.parse
# odeprecated "`brew pr-upload --github-org`", "`brew pr-upload` without `--github-org`" if args.github_org
json_files = Dir["*.bottle.json"] json_files = Dir["*.bottle.json"]
odie "No bottle JSON files found in the current working directory" if json_files.blank? odie "No bottle JSON files found in the current working directory" if json_files.blank?
bottles_hash = bottles_hash_from_json_files(json_files, args) bottles_hash = bottles_hash_from_json_files(json_files, args)
@ -158,8 +159,7 @@ module Homebrew
github_releases = GitHubReleases.new github_releases = GitHubReleases.new
github_releases.upload_bottles(bottles_hash) github_releases.upload_bottles(bottles_hash)
elsif github_packages?(bottles_hash) elsif github_packages?(bottles_hash)
github_org = args.github_org || "homebrew" github_packages = GitHubPackages.new
github_packages = GitHubPackages.new(org: github_org)
github_packages.upload_bottles(bottles_hash, github_packages.upload_bottles(bottles_hash,
keep_old: args.keep_old?, keep_old: args.keep_old?,
dry_run: args.dry_run?, dry_run: args.dry_run?,

View File

@ -33,20 +33,6 @@ class GitHubPackages
"Macintosh" => "darwin", "Macintosh" => "darwin",
}.freeze }.freeze
sig { returns(String) }
def inspect
"#<GitHubPackages: org=#{@github_org}>"
end
sig { params(org: T.nilable(String)).void }
def initialize(org: "homebrew")
@github_org = org
raise UsageError, "Must set a GitHub organisation!" unless @github_org
ENV["HOMEBREW_FORCE_HOMEBREW_ON_LINUX"] = "1" if @github_org == "homebrew" && !OS.mac?
end
sig { sig {
params( params(
bottles_hash: T::Hash[String, T.untyped], bottles_hash: T::Hash[String, T.untyped],