GitHub Packages tweaks
- cleanup comments from #10938 - fix download URL - remove incorrect comment
This commit is contained in:
parent
ab99855c12
commit
d36e99c17c
@ -101,24 +101,27 @@ module Homebrew
|
|||||||
bottle_args += json_files
|
bottle_args += json_files
|
||||||
|
|
||||||
if args.dry_run?
|
if args.dry_run?
|
||||||
service =
|
dry_run_service = if github_packages?(bottles_hash)
|
||||||
if internet_archive?(bottles_hash)
|
# GitHub Packages has its own --dry-run handling.
|
||||||
|
nil
|
||||||
|
elsif internet_archive?(bottles_hash)
|
||||||
"Internet Archive"
|
"Internet Archive"
|
||||||
elsif bintray?(bottles_hash)
|
elsif bintray?(bottles_hash)
|
||||||
"Bintray"
|
"Bintray"
|
||||||
elsif github_releases?(bottles_hash)
|
elsif github_releases?(bottles_hash)
|
||||||
"GitHub Releases"
|
"GitHub Releases"
|
||||||
elsif github_packages?(bottles_hash)
|
|
||||||
"GitHub Packages"
|
|
||||||
else
|
else
|
||||||
odie "Service specified by root_url is not recognized"
|
odie "Service specified by root_url is not recognized"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if dry_run_service
|
||||||
puts <<~EOS
|
puts <<~EOS
|
||||||
brew #{bottle_args.join " "}
|
brew #{bottle_args.join " "}
|
||||||
Upload bottles described by these JSON files to #{service}:
|
Upload bottles described by these JSON files to #{dry_run_service}:
|
||||||
#{json_files.join("\n ")}
|
#{json_files.join("\n ")}
|
||||||
EOS
|
EOS
|
||||||
return unless github_packages?(bottles_hash)
|
return
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
check_bottled_formulae(bottles_hash)
|
check_bottled_formulae(bottles_hash)
|
||||||
|
|||||||
@ -543,6 +543,8 @@ class CurlGitHubPackagesDownloadStrategy < CurlDownloadStrategy
|
|||||||
|
|
||||||
_, org, repo, = *url.match(GitHubPackages::URL_REGEX)
|
_, org, repo, = *url.match(GitHubPackages::URL_REGEX)
|
||||||
|
|
||||||
|
# remove redundant repo prefix for a shorter name
|
||||||
|
repo = repo.delete_prefix("homebrew-")
|
||||||
blob_url = "#{GitHubPackages::URL_PREFIX}#{org}/#{repo}/#{name}/blobs/sha256:#{checksum}"
|
blob_url = "#{GitHubPackages::URL_PREFIX}#{org}/#{repo}/#{name}/blobs/sha256:#{checksum}"
|
||||||
curl_download(blob_url, "--header", "Authorization: Bearer", to: temporary_path)
|
curl_download(blob_url, "--header", "Authorization: Bearer", to: temporary_path)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -46,7 +46,6 @@ class GitHubPackages
|
|||||||
skopeo = Formula["skopeo"].opt_bin/"skopeo"
|
skopeo = Formula["skopeo"].opt_bin/"skopeo"
|
||||||
end
|
end
|
||||||
|
|
||||||
# TODO: these dependencies are installed but cannot be required automatically.
|
|
||||||
Homebrew.install_gem!("json_schemer")
|
Homebrew.install_gem!("json_schemer")
|
||||||
require "json_schemer"
|
require "json_schemer"
|
||||||
|
|
||||||
@ -147,8 +146,8 @@ class GitHubPackages
|
|||||||
source = "https://github.com/#{org}/#{repo}/blob/#{git_revision}/#{git_path}"
|
source = "https://github.com/#{org}/#{repo}/blob/#{git_revision}/#{git_path}"
|
||||||
documentation = if formula.tap.core_tap?
|
documentation = if formula.tap.core_tap?
|
||||||
"https://formulae.brew.sh/formula/#{formula_name}"
|
"https://formulae.brew.sh/formula/#{formula_name}"
|
||||||
else
|
elsif (remote = formula.tap.remote) && remote.start_with?("https://github.com/")
|
||||||
formula.tap.remote
|
remote
|
||||||
end
|
end
|
||||||
|
|
||||||
formula_annotations_hash = {
|
formula_annotations_hash = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user