62 Commits

Author SHA1 Message Date
Bo Anderson
ae91ec2772
github_packages: handle "manifest unknown" 2021-04-12 18:58:28 +01:00
Bo Anderson
503f6dc049
github_packages: safer handling of skopeo inspect 2021-04-11 05:04:15 +01:00
Bo Anderson
57e4209e9c
github_packages: support --keep-old 2021-04-09 17:55:12 +01:00
Bo Anderson
342a697459
github_packages: fix bottle tag handling 2021-04-09 01:55:42 +01:00
Mike McQuaid
eb25bf3668
github_packages: fix "Uploaded to" organisation.
This is hardcoded to Homebrew but we've started uploading bottles to
the Linuxbrew org.
2021-04-08 11:48:46 +01:00
Mike McQuaid
4cbc34d31d
Merge pull request #11071 from MikeMcQuaid/linuxbrew-url-fix
Fix Linuxbrew URL handling
2021-04-08 11:12:39 +01:00
Mike McQuaid
598c230e12
Fix Linuxbrew URL handling
After this `HOMEBREW_BOTTLE_DOMAIN=https://ghcr.io/v2/linuxbrew/core`
will work as expected.

While we're here, do a bit of cleanup of constant usage; we don't want
some of these leaking outside the `GitHubPackages` class.

In doing so `docker://` will continue to work for `ghcr.io` but won't
work for arbitrary other Docker hosts; this isn't something we want to
support yet.
2021-04-08 10:54:28 +01:00
Mike McQuaid
0ff9bf6cb4
github_packages: fix source for Linuxbrew bottles.
Addresses https://github.com/Homebrew/brew/pull/11056#issuecomment-815261503
2021-04-08 10:22:30 +01:00
Mike McQuaid
aafc5b6e98
github_packages: rewrite more invalid versions.
Needed for `picat` and `srmio`.
2021-04-08 09:32:23 +01:00
Mike McQuaid
7b8d97aead
github_packages: quiet skopeo inspect
We want this to fail so don't print out the (expected) `stderr` output.
2021-04-07 17:34:05 +01:00
Mike McQuaid
1435018e11
Merge pull request #11057 from MikeMcQuaid/github_packages_more_fixes
More GitHub Packages bulk upload fixes
2021-04-07 17:26:03 +01:00
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