ruff/.github/workflows
samypr100 7dbd8f0f8e
ci(docker): incorporate docker release enhancements from uv (#13274)
## Summary

This PR updates `ruff` to match `uv` updated [docker releases
approach](https://github.com/astral-sh/uv/blob/main/.github/workflows/build-docker.yml).
It's a combined PR with changes from these PR's
* https://github.com/astral-sh/uv/pull/6053
* https://github.com/astral-sh/uv/pull/6556
* https://github.com/astral-sh/uv/pull/6734
* https://github.com/astral-sh/uv/pull/7568

Summary of changes / features

1. This change would publish an additional tags that includes only
`major.minor`.

    For a release with `x.y.z`, this would publish the tags:

    * ghcr.io/astral-sh/ruff:latest
    * ghcr.io/astral-sh/ruff:x.y.z
    * ghcr.io/astral-sh/ruff:x.y

2. Parallelizes multi-platform builds using multiple workers (hence the
new docker-build / docker-publish jobs), which cuts docker releases time
in half.

3. This PR introduces additional images with the ruff binaries from
scratch for both amd64/arm64 and makes the mapping easy to configure by
generating the Dockerfile on the fly. This approach focuses on
minimizing CI time by taking advantage of dedicating a worker per
mapping (20-30s~ per job). For example, on release `x.y.z`, this will
publish the following image tags with format
`ghcr.io/astral-sh/ruff:{tag}` with manifests for both amd64/arm64. This
also include `x.y` tags for each respective additional tag. Note, this
version does not include the python based images, unlike `uv`.

* From **scratch**: `latest`, `x.y.z`, `x.y` (currently being published)
* From **alpine:3.20**: `alpine`, `alpine3.20`, `x.y.z-alpine`,
`x.y.z-alpine3.20`
* From **debian:bookworm-slim**: `debian-slim`, `bookworm-slim`,
`x.y.z-debian-slim`, `x.y.z-bookworm-slim`
* From **buildpack-deps:bookworm**: `debian`, `bookworm`,
`x.y.z-debian`, `x.y.z-bookworm`

4. This PR also fixes `org.opencontainers.image.version` for all tags
(including the one from `scratch`) to contain the right release version
instead of branch name `main` (current behavior).

    ```
> docker inspect ghcr.io/astral-sh/ruff:0.6.4 | jq -r
'.[0].Config.Labels'
    {
      ...
      "org.opencontainers.image.version": "main"
    }
    ```

Closes https://github.com/astral-sh/ruff/issues/13481

## Test Plan

Approach mimics `uv` with almost no changes so risk is low but I still
tested the full workflow.

* I have a working CI release pipeline on my fork run
https://github.com/samypr100/ruff/actions/runs/10966657733
* The resulting images were published to
https://github.com/samypr100/ruff/pkgs/container/ruff
2024-10-22 07:06:49 -05:00
..
build-binaries.yml Update to macOS14 runner image (#13728) 2024-10-18 11:43:30 +02:00
build-docker.yml ci(docker): incorporate docker release enhancements from uv (#13274) 2024-10-22 07:06:49 -05:00
ci.yaml Upgrade to Rust 1.82 (#13816) 2024-10-19 16:05:50 +02:00
daily_fuzz.yaml Add a daily workflow to fuzz the parser with randomly selected seeds (#11203) 2024-04-29 17:54:17 +01:00
notify-dependents.yml Migrate release workflow to `cargo-dist` (#9559) 2024-06-27 13:44:11 +02:00
pr-comment.yaml Allow downloading ecosystem results from forks (#12544) 2024-07-27 19:57:19 +02:00
publish-docs.yml Point docs to Astral favicon (#13219) 2024-09-02 20:11:39 -04:00
publish-playground.yml Update cloudflare/wrangler-action action to v3.9.0 (#13846) 2024-10-21 20:53:32 +01:00
publish-pypi.yml Migrate release workflow to `cargo-dist` (#9559) 2024-06-27 13:44:11 +02:00
publish-wasm.yml Upgrade to Rust 1.82 (#13816) 2024-10-19 16:05:50 +02:00
release.yml Upgrade to latest `cargo-dist` version (#13416) 2024-09-20 15:59:32 -04:00
sync_typeshed.yaml Rename the `ruff_vendored` crate to `red_knot_vendored` (#13586) 2024-10-01 16:16:59 +01:00