github_packages: Add sh.brew.bottle.glibc.version

This commit is contained in:
Shaun Jackman 2021-04-02 17:42:15 -07:00
parent 4e94f75bcb
commit a3feb12712
No known key found for this signature in database
GPG Key ID: D4ED5223F4E57996

View File

@ -240,15 +240,15 @@ class GitHubPackages
when "darwin" when "darwin"
os_version || "macOS #{MacOS::Version.from_symbol(bottle_tag)}" os_version || "macOS #{MacOS::Version.from_symbol(bottle_tag)}"
when "linux" when "linux"
glibc_version = tab["built_on"]["glibc_version"] if tab["built_on"].present? (os_version || "Ubuntu 16.04.7").delete_suffix " LTS"
os_version ||= "Ubuntu 16.04.7"
glibc_version ||= "2.23"
os_version = os_version.delete_suffix " LTS"
"#{os_version} glibc #{glibc_version}"
else else
os_version os_version
end end
glibc_version = if os == "linux"
(tab["built_on"]["glibc_version"] if tab["built_on"].present?) || "2.23"
end
platform_hash = { platform_hash = {
architecture: architecture, architecture: architecture,
os: os, os: os,
@ -271,6 +271,7 @@ class GitHubPackages
"org.opencontainers.image.ref.name" => tag, "org.opencontainers.image.ref.name" => tag,
"org.opencontainers.image.title" => "#{formula_full_name} #{tag}", "org.opencontainers.image.title" => "#{formula_full_name} #{tag}",
"com.github.package.type" => GITHUB_PACKAGE_TYPE, "com.github.package.type" => GITHUB_PACKAGE_TYPE,
"sh.brew.bottle.glibc.version" => glibc_version,
}).sort.to_h }).sort.to_h
annotations_hash.each do |key, value| annotations_hash.each do |key, value|
annotations_hash.delete(key) if value.blank? annotations_hash.delete(key) if value.blank?
@ -304,8 +305,9 @@ class GitHubPackages
annotations: { annotations: {
"org.opencontainers.image.ref.name" => tag, "org.opencontainers.image.ref.name" => tag,
"sh.brew.bottle.digest" => tar_gz_sha256, "sh.brew.bottle.digest" => tar_gz_sha256,
"sh.brew.bottle.glibc.version" => glibc_version,
"sh.brew.tab" => tab.to_json, "sh.brew.tab" => tab.to_json,
}, }.compact,
} }
end end