Merge pull request #11007 from MikeMcQuaid/github_package_type

github_packages: set github package type annotation.
This commit is contained in:
Mike McQuaid
2021-04-02 15:57:51 +01:00
committed by GitHub
+2
View File
@@ -16,6 +16,7 @@ class GitHubPackages
URL_PREFIX = "https://#{URL_DOMAIN}/v2/"
DOCKER_PREFIX = "docker://#{URL_DOMAIN}/"
URL_REGEX = %r{(?:#{Regexp.escape(URL_PREFIX)}|#{Regexp.escape(DOCKER_PREFIX)})([\w-]+)/([\w-]+)}.freeze
GITHUB_PACKAGE_TYPE = "homebrew_bottle"
# Translate Homebrew tab.arch to OCI platform.architecture
TAB_ARCH_TO_PLATFORM_ARCHITECTURE = {
@@ -255,6 +256,7 @@ class GitHubPackages
"org.opencontainers.image.documentation" => documentation,
"org.opencontainers.image.ref.name" => tag,
"org.opencontainers.image.title" => "#{formula_full_name} #{tag}",
"com.github.package.type" => GITHUB_PACKAGE_TYPE,
}).sort.to_h
annotations_hash.each do |key, value|
annotations_hash.delete(key) if value.blank?