101 Commits

Author SHA1 Message Date
Mike McQuaid
8800b85f64
More GitHub Packages bulk upload fixes
- replace invalid non-ASCII characters from the descriptions
- handle invalid macOS versions on attempting to load old formulae from
  old bottles
- let `rubocop` auto-remove a no-longer needed `rubocop:disable`
- fix `skopeo` credentials argument
2021-04-07 17:03:44 +01:00
Mike McQuaid
c141dd4480
github_packages: don't allow linuxbrew- prefix.
Given https://github.com/Homebrew/linuxbrew-core/pull/22874 we no longer
need/want to allow a `linuxbrew-` repository prefix.
2021-04-07 16:34:59 +01:00
Nanda H Krishna
11de11025b
github_packages: fix image_formula_name issue 2021-04-07 19:33:16 +05:30
Mike McQuaid
4613d368d9
Merge pull request #11054 from MikeMcQuaid/github_packages_image_tag_cleanup
github_packages: remove invalid docker tag characters.
2021-04-07 14:00:01 +01:00
Mike McQuaid
d707c0bbd8
github_packages: remove invalid docker tag characters.
Some versions have `+` in them.
2021-04-07 13:32:31 +01:00
Mike McQuaid
ee491928e4
github_packages: fix typo. 2021-04-07 13:20:24 +01:00
Mike McQuaid
b0ba92466f
github_packages: fix more bulk upload errors.
- replace `+` in formula names (because it's an invalid character)
- do a `skopeo inspect` first to avoid overwriting existing packages
2021-04-07 12:48:34 +01:00
Mike McQuaid
fd251c9109
github_packages: fix versioned bottle names.
`@` cannot be used in Docker image names. Use `/` instead (which we
already use in image names so has some precedent).

Make `mktemp` use `AT` (consistent with `Formula` subclasses), too.
2021-04-06 19:14:08 +01:00
Mike McQuaid
480d943035
Merge pull request #11036 from sjackman/sj/ghcr-compact
GHCR: Use reject to remove empty hash values
2021-04-06 08:52:55 +01:00
Shaun Jackman
d6c0bbc7f4 GHCR: Add constant OS::CI_OS_VERSION
Rename constant OS::GLIBC_CI_VERSION to OS::CI_GLIBC_VERSION.
2021-04-05 22:39:41 -07:00
Shaun Jackman
2852d9f0de
GHCR: Use reject to remove empty hash values 2021-04-05 10:08:03 -07:00
Mike McQuaid
cdaeee03c4
GitHub Packages cleanup
- `download_strategy`: only request image index JSON for downloading
  the manifest for the tab
- use a shared `OS` constant for the version of `glibc` we use in CI
- fix `skoepeo` typo
- ensure that blank hash values are deleted (again) rather than just
  `nil` ones
- use a shared `Hardware::CPU` constant for oldest CPU we're
  supporting/using on Intel 64-bit
- re-add comment to `software_spec`
2021-04-05 14:58:17 +01:00
Shaun Jackman
e627885e16 OCI: Move CPU variant to sh.brew.cpu.variant 2021-04-03 18:58:52 -07:00
Shaun Jackman
f35baa2752 OCI: Add sh.brew.tab to the image manifest
The tab is needed to install the package using
the SHA-256 of the single-architecture image.
2021-04-03 15:01:44 -07:00
Shaun Jackman
244cacf1c4
github_packages: Add platform.variant on Linux only 2021-04-02 18:42:53 -07:00
Shaun Jackman
1b25224b55
github_packages: Add platform.variant 2021-04-02 18:42:52 -07:00
Shaun Jackman
2b7824f7de
github_packages: Use hash compact 2021-04-02 18:01:42 -07:00
Shaun Jackman
a3feb12712
github_packages: Add sh.brew.bottle.glibc.version 2021-04-02 18:01:11 -07:00
Shaun Jackman
4e94f75bcb
github_packages: Add glibc to os.version on Linux 2021-04-02 12:31:42 -07:00
Mike McQuaid
15beab1859
github_packages: odie on missing skopeo.
If `HOMEBREW_FORCE_HOMEBREW_ON_LINUX` is set then we don't want to
try to `brew install` or it will try and install from source (which
takes too long).
2021-04-02 17:29:52 +01:00
Mike McQuaid
38456848a7
Merge pull request #11010 from MikeMcQuaid/github_package_ci_upload_fixes
GitHub Packages CI upload fixes
2021-04-02 17:12:56 +01:00
Mike McQuaid
0ec1f04e63
GitHub Packages CI upload fixes
- Add `--no-commit` option to `brew pr-pull` and pass to
  `brew pr-upload`
- Use `skopeo` from `PATH` if available (as it takes a while to build on
  CI)
2021-04-02 16:51:18 +01:00
Shaun Jackman
07639e8ceb write_image_index: Remove Docker mediaType
Remove `mediaType: "application/vnd.docker.distribution.manifest.list.v2+json"`
previously needed for correct multi-arch display in GitHub Packages UI.
2021-04-02 08:23:31 -07:00
Mike McQuaid
93c2482df2
github_packages: set github package type annotation.
This is an alternative to #11002.
2021-04-02 15:37:42 +01:00
Mike McQuaid
a7d253a8a7
Merge pull request #10997 from sjackman/sj/bottle-digest
github_packages: Rename sh.brew.bottle.digest
2021-04-02 10:36:18 +01:00
Shaun Jackman
3141d493ca
github_packages: Rename sh.brew.bottle.digest
Rename sh.brew.bottle.checksum to sh.brew.bottle.digest
for consistency with the OCI descriptor spec.
2021-04-02 10:13:27 +01:00
Mike McQuaid
0c355d907a
Revert "github_packages: update mediaType." 2021-04-02 09:56:12 +01:00
Mike McQuaid
d758047759
github_packages: backfill missing tab entries. 2021-04-01 17:37:16 +01:00
Shaun Jackman
95b44eab49
github_packages: adjust rebuild handling 2021-04-01 17:37:16 +01:00
Mike McQuaid
4f57adf42f
github_packages: fix org.opencontainers.image.created. 2021-04-01 17:37:16 +01:00
Mike McQuaid
a50ec38d31
github_packages: add helper class methods. 2021-04-01 17:37:16 +01:00
Mike McQuaid
8f78b93351
Merge pull request #10978 from MikeMcQuaid/github_packages_media_type
github_packages: update mediaType.
2021-04-01 15:06:50 +01:00
Shaun Jackman
9f9c5df047
github_packages: Translate tab.arch to OCI
Translate Homebrew tab.arch to OCI platform.architecture.
2021-03-31 12:41:24 -07:00
Mike McQuaid
39a488ca07
github_packages: update mediaType.
This custom type will allow better display in GitHub Packages.
2021-03-31 20:38:53 +01:00
Shaun Jackman
4954505920
github_packages: Translate built_on to platform OS 2021-03-31 09:43:37 +01:00
Mike McQuaid
5818b7871d
github_packages: Fix org.opencontainers.image.source 2021-03-31 09:43:37 +01:00
Shaun Jackman
fe5e8b820a
github_packages: change tap_git_head to tap_git_revision, add fallback. 2021-03-31 09:43:37 +01:00
Shaun Jackman
bb7a3ce7e5
github_packages: write_index_json: add image.ref.name 2021-03-31 09:43:37 +01:00
Mike McQuaid
d8a2cf9efc
Write tabs to bottle JSON, optionally not bottle
- Write a subset of the tab required for bottles as an annotation.
- Add option on new bottle creation to skip writing tab into bottle
  and instead add it (and other useful metadata) to bottle JSON.
- Read formula information and tab from bottle JSON.
- Write prettier JSON to disk.
- Don't write `HEAD` to tab; this duplicates `HOMEBREW_VERSION`.
- Allow `brew bottle` to use `--json` to generate JSON files from a
  local bottle file.
2021-03-31 09:43:37 +01:00
Mike McQuaid
d36e99c17c
GitHub Packages tweaks
- cleanup comments from #10938
- fix download URL
- remove incorrect comment
2021-03-30 08:42:15 +01:00
Shaun Jackman
c193cb9848
github_packages: Add annotations to image index
When `brew pr-upload` is run with `--dry-run`, write the OCI directory,
but do not upload it.
2021-03-29 17:11:38 +01:00
Shaun Jackman
a631377fd2
pr-upload: Fix GitHub Packages for Linux
Fix GitHub Packages for Linux and third-party taps.

- Copy all architecture images using `skopeo copy --all`
2021-03-29 17:11:21 +01:00
Mike McQuaid
7f1ac4cdae
github_packages: tweak package name and output URL 2021-03-29 15:10:43 +01:00
Mike McQuaid
725f2828b4
github_packages: add mediaType comment. 2021-03-29 14:48:59 +01:00
Mike McQuaid
490ffb70de
github_packages: import fixes from #10947 2021-03-29 14:48:58 +01:00
Mike McQuaid
5f31ebd8d4
github_packages: use json_schemer gem.
Instead of the deprecated json-schema.
2021-03-29 14:48:58 +01:00
Mike McQuaid
169a1bae13
github_packages: various improvements.
- validate all JSON files against their JSON schemas
- remove existing/lingering JSON files
- improve naming based on schema understanding
- add more (empty) annotations hashes where valid
- output prettier JSON
- fix non-SHA256 output filenames
2021-03-25 10:29:26 +00:00
Mike McQuaid
74f31af8d4
github_packages: use skopeo.
`skopeo` allows replacing `docker` and `oras` with a single tool that
behaves in a way that's a little more intuitive for us (we build the
directory structure on disk and upload that). It seems to be better at
preserving our metadata, too.

Take the opportunity for writing out more metadata ourselves to split
out more logic into separate functions.

While we're here, fix the `download_strategy` timeout handling for
GitHub Packages.
2021-03-19 21:09:18 +00:00
Mike McQuaid
0f87bf38d7
github_packages: improve metadata.
- add more metadata to the images on upload
- stitch together images using Docker's CLI
- more code cleanup
2021-03-18 12:58:15 +00:00
Mike McQuaid
7fc52d2065
github_packages: fix HOMEBREW_BOTTLE_DOMAIN usage.
This still worked but ended up always having a `/bottles-*/` part of the
URL that was unnecessary when using `HOMEBREW_BOTTLE_DOMAIN`.
2021-03-16 15:17:42 +00:00