Container Images #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Container Images | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '30 3 * * 0' | |
workflow_dispatch: | |
inputs: | |
include_eol: | |
description: 'Build also EOL-ed suites' | |
type: boolean | |
default: false | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
env: | |
INCLUDE_EOL: ${{ inputs.include_eol && 'true' || '' }} | |
jobs: | |
matrix: | |
name: Build Matrix | |
runs-on: ubuntu-latest | |
outputs: | |
full_json: ${{ steps.releases.outputs.json }} | |
codenames: ${{ steps.pp.outputs.codenames }} | |
codename_arch: ${{ steps.pp.outputs.codename_arch }} | |
steps: | |
- name: Releases Info | |
id: releases | |
uses: vicamo/actions-library/ubuntu-releases@v1 | |
- name: Post Processing | |
id: pp | |
env: | |
FULL_JSON: ${{ steps.releases.outputs.json }} | |
run: | | |
platforms='[ | |
["amd64", "linux/amd64"], | |
["arm", "linux/arm"], | |
["arm64", "linux/arm64/v8"], | |
["armel", "linux/arm/v5"], | |
["armhf", "linux/arm/v7"], | |
["i386", "linux/386"], | |
["loong64", "linux/loong64"], | |
["mips64el", "linux/mips64le"], | |
["ppc64el", "linux/ppc64le"], | |
["riscv64", "linux/riscv64"], | |
["s390x", "linux/s390x"], | |
["mips", "linux/mips"], | |
["mipsel", "linux/mipsle"], | |
["powerpc", "linux/ppc"], | |
["ppc64", "linux/ppc64"], | |
["s390", "linux/s390"], | |
["sparc", "linux/sparc"], | |
["sparc64", "linux/sparc64"], | |
["x32", "linux/amd64p32"], | |
["alpha", "linux/alpha"], | |
["hppa", "linux/hppa"], | |
["lpia", "linux/386"], | |
["m68k", "linux/m68k"], | |
["sh4", "linux/sh4"] | |
]' | |
disabled_codename='[]' | |
disabled_arches='["hurd-amd64", "hurd-i386", "ia64", "kfreebsd-amd64", "kfreebsd-i386", "s390", "x32"]' | |
known_failures='[ | |
["artful", "arm64", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/7"], | |
["artful", "armhf", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/7"], | |
["artful", "ppc64el", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/7"], | |
["artful", "s390x", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/7"], | |
["breezy", "sparc", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/11"], | |
["edgy", "amd64", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/14"], | |
["edgy", "i386", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/14"], | |
["edgy", "hppa", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/12"], | |
["edgy", "powerpc", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/14"], | |
["edgy", "sparc", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/14"], | |
["feisty", "hppa", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/12"], | |
["gutsy", "sparc", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/11"], | |
["hardy", "sparc", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/11"], | |
["hoary", "amd64", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/13"], | |
["hoary", "i386", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/13"], | |
["hoary", "powerpc", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/13"], | |
["hoary", "sparc", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/13"], | |
["precise", "armel", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/10"], | |
["precise", "powerpc", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/10"], | |
["trusty", "powerpc", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/6"], | |
["utopic", "amd64", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/8"], | |
["utopic", "arm64", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/9"], | |
["utopic", "armhf", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/8"], | |
["utopic", "i386", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/8"], | |
["utopic", "powerpc", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/8"], | |
["utopic", "ppc64el", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/9"], | |
["vivid", "amd64", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/8"], | |
["vivid", "armhf", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/9"], | |
["vivid", "i386", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/9"], | |
["warty", "amd64", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/13"], | |
["warty", "i386", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/13"], | |
["warty", "powerpc", "https://github.com/vicamo/docker-brew-ubuntu-debootstrap/issues/13"] | |
]' | |
pin_timestamp='[]' | |
pin_qemu='[ | |
["any", "alpha", "ubuntu"], | |
["any", "hppa", "ubuntu"], | |
["any", "m68k", "ubuntu"], | |
["any", "mips", "ubuntu"], | |
["any", "mipsel", "ubuntu"], | |
["any", "powerpc", "ubuntu"], | |
["any", "ppc64", "ubuntu"], | |
["any", "sh4", "ubuntu"], | |
["any", "sparc", "ubuntu"], | |
["any", "sparc64", "ubuntu"] | |
]' | |
codenames="$(echo "${FULL_JSON}" | | |
jq -c -M 'map(select(.codename as $c | | |
'"${disabled_codename}"' | | |
index($c) == null)) | | |
map(. as $s | | |
$s.mirrors[0].pockets[$s.codename].architectures as $da | | |
$s | | |
{ | |
"distribution":.distribution, | |
"release":.release, | |
"codename":.codename, | |
"suite":.suite, | |
"active":.active, | |
"architectures":(.architectures - '"${disabled_arches}"' | | |
map({ | |
"arch":., | |
"platform":(. as $arch | | |
'"${platforms}"' | | |
map(select(.[0] == $arch))[0][1]), | |
"use_ports":(. as $arch | | |
$da | | |
index($arch) == null), | |
"known_failure":(. as $arch | | |
'"${known_failures}"' | | |
map(select((.[0] == $s.codename) and (.[1] == $arch)) | .[2]) | | |
first), | |
"timestamp":(. as $arch | | |
'"${pin_timestamp}"' | | |
map(select((.[0] == $s.codename) and (.[1] == $arch)) | .[2]) | | |
first), | |
"qemu":(. as $arch | | |
'"${pin_qemu}"' | | |
map(select(((.[0] == $s.codename) and (.[1] == $arch)) | |
or ((.[0] == "any") and (.[1] == $arch)) | |
or ((.[0] == $s.codename) and (.[1] == "any"))) | .[2]) | | |
first), | |
}) | | |
tostring) | |
})')" | |
if [ -z "${INCLUDE_EOL}" ]; then | |
codenames="$(echo "${codenames}" | jq -c -M 'map(select(.active))')" | |
fi | |
echo "::group::Built JSON(codenames)" | |
echo "${codenames}" | jq | |
echo "::endgroup::" | |
echo "codenames=${codenames}" | tee -a "${GITHUB_OUTPUT}" | |
debuerreotype: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Debuerreotype | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
repository: ${{ github.repository }} | |
ref: helper/20240509 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
version: v0.12.0 | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: '.' | |
outputs: type=docker,dest=/tmp/debuerreotype.tar | |
tags: local/debuerreotype:latest | |
- name: Upload debuerreotype image tarball | |
uses: actions/upload-artifact@v4 | |
with: | |
name: debuerreotype | |
path: /tmp/debuerreotype.tar | |
per-suite: | |
name: Per Suite | |
needs: | |
- debuerreotype | |
- matrix | |
strategy: | |
fail-fast: false | |
max-parallel: 1 | |
matrix: | |
include: ${{ fromJSON(needs.matrix.outputs.codenames) }} | |
uses: ./.github/workflows/per-suite.yml | |
secrets: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
with: | |
distribution: ${{ matrix.distribution }} | |
release: ${{ matrix.release }} | |
codename: ${{ matrix.codename }} | |
suite: ${{ matrix.suite }} | |
active: ${{ matrix.active }} | |
architectures: ${{ matrix.architectures }} | |
repository: 'vicamo/ubuntu' | |
dry_run: ${{ github.ref_name != 'main' }} |