Revert "Update GitHubPackages for new Tab implementation"

This commit is contained in:
Issy Long 2023-03-15 23:12:37 +00:00 committed by GitHub
parent 96ae878808
commit 1e64a658d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -315,28 +315,28 @@ class GitHubPackages
tar_gz_sha256 = write_tar_gz(local_file, blobs) tar_gz_sha256 = write_tar_gz(local_file, blobs)
tab = tag_hash["tab"] tab = tag_hash["tab"]
architecture = TAB_ARCH_TO_PLATFORM_ARCHITECTURE[tab.arch.presence || bottle_tag.arch.to_s] architecture = TAB_ARCH_TO_PLATFORM_ARCHITECTURE[tab["arch"].presence || bottle_tag.arch.to_s]
raise TypeError, "unknown tab.arch: #{tab.arch}" if architecture.blank? raise TypeError, "unknown tab['arch']: #{tab["arch"]}" if architecture.blank?
os = if tab["built_on"].present? && tab.built_on["os"].present? os = if tab["built_on"].present? && tab["built_on"]["os"].present?
BUILT_ON_OS_TO_PLATFORM_OS[tab.built_on["os"]] BUILT_ON_OS_TO_PLATFORM_OS[tab["built_on"]["os"]]
elsif bottle_tag.linux? elsif bottle_tag.linux?
"linux" "linux"
else else
"darwin" "darwin"
end end
raise TypeError, "unknown tab.built_on['os']: #{tab.built_on["os"]}" if os.blank? raise TypeError, "unknown tab['built_on']['os']: #{tab["built_on"]["os"]}" if os.blank?
os_version = tab.built_on["os_version"].presence if tab.built_on.present? os_version = tab["built_on"]["os_version"].presence if tab["built_on"].present?
case os case os
when "darwin" when "darwin"
os_version ||= "macOS #{bottle_tag.to_macos_version}" os_version ||= "macOS #{bottle_tag.to_macos_version}"
when "linux" when "linux"
os_version&.delete_suffix!(" LTS") os_version&.delete_suffix!(" LTS")
os_version ||= OS::LINUX_CI_OS_VERSION os_version ||= OS::LINUX_CI_OS_VERSION
glibc_version = tab.built_on["glibc_version"].presence if tab.built_on.present? glibc_version = tab["built_on"]["glibc_version"].presence if tab["built_on"].present?
glibc_version ||= OS::LINUX_GLIBC_CI_VERSION glibc_version ||= OS::LINUX_GLIBC_CI_VERSION
cpu_variant = tab.built_on&.(:[], "oldest_cpu_family") || Hardware::CPU::INTEL_64BIT_OLDEST_CPU.to_s cpu_variant = tab["oldest_cpu_family"] || Hardware::CPU::INTEL_64BIT_OLDEST_CPU.to_s
end end
platform_hash = { platform_hash = {