Skip to content

♲ manylinux containers #382

♲ manylinux containers

♲ manylinux containers #382

---
name: ♲ manylinux containers
on: # yamllint disable-line rule:truthy
workflow_dispatch:
schedule:
# Run once a week on Mondays
- cron: 0 0 * * MON
pull_request:
paths:
- .github/workflows/build-manylinux-container-images.yml
- build-scripts/manylinux-container-image/**
push:
branches:
- devel
paths:
- .github/workflows/build-manylinux-container-images.yml
- build-scripts/manylinux-container-image/**
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
IMAGE:
# Build containers for x86_64
- ARCH: x86_64
QEMU_ARCH: amd64
# Build containers for aarch64 (ARM 64)
- ARCH: aarch64
QEMU_ARCH: arm64
# Build containers for ppc64le
- ARCH: ppc64le
# Build containers for s390x
- ARCH: s390x
# There are no base containers for these archs
# at https://quay.io/organization/pypa.
# Build containers for armv7l (ARM v7)
# - ARCH: armv7l
# QEMU_ARCH: arm/v7
# Build containers for ppc64
# - ARCH: ppc64
YEAR:
- 2014
- _2_24 # PEP 600
- _2_28
include:
- IMAGE:
ARCH: x86_64
QEMU_ARCH: amd64
YEAR: 1
- IMAGE:
ARCH: x86_64
QEMU_ARCH: amd64
YEAR: 2010
env:
LIBSSH_VERSION: 0.9.6
PYPA_MANYLINUX_TAG: >-
manylinux${{ matrix.YEAR }}_${{ matrix.IMAGE.ARCH }}
FULL_IMAGE_NAME: >-
${{
github.repository
}}-manylinux${{
matrix.YEAR
}}_${{
matrix.IMAGE.ARCH
}}
QEMU_ARCH: ${{ matrix.IMAGE.QEMU_ARCH || matrix.IMAGE.ARCH }}
defaults:
run:
working-directory: build-scripts/manylinux-container-image/
name: >- # can't use `env` in this context:
🐳
manylinux${{ matrix.YEAR }}_${{ matrix.IMAGE.ARCH }}
steps:
- name: Fetch the repo src
uses: actions/[email protected]
- name: >-
Set up QEMU ${{ env.QEMU_ARCH }} arch emulation
with Podman
if: env.QEMU_ARCH != 'amd64'
run: >-
sudo podman run
--rm --privileged
multiarch/qemu-user-static
--reset -p yes
- name: Build the image with Buildah
id: build-image
uses: redhat-actions/[email protected]
with:
arch: linux/${{ env.QEMU_ARCH }}
image: ${{ env.FULL_IMAGE_NAME }}
tags: >-
${{ github.sha }}
libssh-v${{ env.LIBSSH_VERSION }}_gh-${{ github.sha }}
libssh-v${{ env.LIBSSH_VERSION }}
latest
dockerfiles: build-scripts/manylinux-container-image/Dockerfile
context: build-scripts/manylinux-container-image/
oci: true # Should be alright because we don't publish to Docker Hub
build-args: |
LIBSSH_VERSION=${{ env.LIBSSH_VERSION }}
RELEASE=${{ env.PYPA_MANYLINUX_TAG }}
- name: Push to GitHub Container Registry
if: >-
(github.event_name == 'push' || github.event_name == 'schedule')
&& github.ref == format(
'refs/heads/{0}', github.event.repository.default_branch
)
id: push-to-ghcr
uses: redhat-actions/[email protected]
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Log the upload result
if: >-
(github.event_name == 'push' || github.event_name == 'schedule')
&& github.ref == format(
'refs/heads/{0}', github.event.repository.default_branch
)
run: >-
echo
'New image has been pushed to
${{ steps.push-to-ghcr.outputs.registry-paths }}'
...