Skip to content

Commit b98030c

Browse files
committed
1 parent d2133e6 commit b98030c

File tree

2 files changed

+33
-13
lines changed

2 files changed

+33
-13
lines changed

.github/workflows/build_and_test.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,18 @@ jobs:
116116
PLATFORMS="`docker manifest inspect ${{ env.BASE_IMAGE }} | \
117117
jq -r '.manifests[] | "\(.platform.os)/\(.platform.architecture)\(if .platform.variant != null then "/\(.platform.variant)" else "" end)"' | \
118118
sort -u | grep -v unknown | paste -sd ','`"
119-
BUILD_MATRIX="`echo ${PLATFORMS} | tr ',' '\n' | jq -R . | jq -s . | tr '\n' ' '`"
120-
GIT_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
121-
GIT_BRANCH="${GIT_BRANCH#refs/tags/}"
122-
BUILD_IMAGE="${{ inputs.ghcr-repo }}:rtp.io-${{ inputs.rtpp-tag }}-${GIT_BRANCH}"
123119
echo "Platforms: ${PLATFORMS}"
124-
echo "platforms=${PLATFORMS}" >> $GITHUB_OUTPUT
125-
echo "build-matrix=${BUILD_MATRIX}" >> $GITHUB_OUTPUT
126-
echo "build-image=${BUILD_IMAGE}" >> $GITHUB_OUTPUT
127-
echo "git-branch=${GIT_BRANCH}" >> $GITHUB_OUTPUT
120+
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
128121
129-
- name: build
130-
run: |
131-
python${PY_VER} setup.py build sdist
132-
python${PY_VER} -m build --wheel
133-
auditwheel repair dist/*.whl --wheel-dir dist/
122+
- name: Build Docker image
123+
uses: docker/build-push-action@v6
124+
with:
125+
context: .
126+
file: ./docker/Dockerfile.python_wheels
127+
build-args: |
128+
BASE_IMAGE=${{ env.BASE_IMAGE }}
129+
PY_VER=${{ env.PY_VER }}
130+
platforms: ${{ env.PLATFORMS }}
134131

135132
- name: Publish package distributions to PyPI
136133
if: github.event_name == 'release' && github.event.action == 'created'

docker/Dockerfile.python_wheels

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# syntax=docker/dockerfile:1.7-labs
2+
3+
ARG BASE_IMAGE="quay.io/pypa/manylinux_2_28:latest"
4+
FROM --platform=$TARGETPLATFORM $BASE_IMAGE AS build
5+
LABEL maintainer="Maksym Sobolyev <[email protected]>"
6+
7+
USER root
8+
9+
WORKDIR /src
10+
11+
ARG TARGETPLATFORM
12+
ARG PY_VER
13+
RUN --mount=type=bind,source=scripts/build,target=scripts/build \
14+
sh -x scipts/build/install_depends_yum.sh
15+
RUN --mount=type=bind,source=scripts/build,target=scripts/build \
16+
sh -x scipts/build/install_depends_wheels.sh
17+
18+
COPY --exclude=.git --exclude=.github --exclude=docker --exclude=dist \
19+
--exclude=scripts . .
20+
21+
RUN python${PY_VER} setup.py build sdist
22+
RUN python${PY_VER} -m build --wheel
23+
RUN auditwheel repair dist/*.whl --wheel-dir dist/

0 commit comments

Comments
 (0)