github_packages: set github package type annotation.

This is an alternative to #11002.
This commit is contained in:
Mike McQuaid 2021-04-02 15:37:42 +01:00
parent f266acff2d
commit 93c2482df2
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70

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?