@@ -48,57 +48,90 @@ jobs:
4848
4949 # Steps represent a sequence of tasks that will be executed as part of the job
5050 steps :
51- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
52- - uses : actions/checkout@v4
53-
54- - name : Set up Python ${{ matrix.python-version }}
55- uses : actions/setup-python@v5
56- with :
57- python-version : ${{ matrix.python-version }}
58-
59- - name : Install dependencies
60- run : |
61- python -m pip install --upgrade pip
62- pip install setuptools wheel
63- shell : bash
64-
65- - name : build
66- run : CC=${COMPILER} LDSHARED="${COMPILER} -shared" python setup.py build sdist
67- shell : bash
68-
69- - name : install
70- run : pip install dist/*.gz
71- shell : bash
72-
73- - name : test
74- run : |
75- python -m unittest discover -v -s tests -p '*.py'
76- shell : bash
77-
78- publish_wheels :
51+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
52+ - uses : actions/checkout@v4
53+
54+ - name : Set up Python ${{ matrix.python-version }}
55+ uses : actions/setup-python@v5
56+ with :
57+ python-version : ${{ matrix.python-version }}
58+
59+ - name : Install dependencies
60+ run : |
61+ python -m pip install --upgrade pip
62+ pip install --upgrade build setuptools wheel
63+ shell : bash
64+
65+ - name : build
66+ run : CC=${COMPILER} LDSHARED="${COMPILER} -shared" python setup.py build sdist
67+ shell : bash
68+
69+ - name : install
70+ run : pip install dist/*.gz
71+ shell : bash
72+
73+ - name : test
74+ run : |
75+ python -m unittest discover -v -s tests -p '*.py'
76+ shell : bash
77+
78+ python_wheels :
7979 needs : build_and_test_python
80- if : github.event_name == 'release' && github.event.action == 'created'
8180 runs-on : ubuntu-latest
81+ container :
82+ image : quay.io/pypa/manylinux_2_28:latest
83+ env :
84+ PY_VER : ${{ matrix.python-version }}
85+ BASE_IMAGE : quay.io/pypa/manylinux_2_28:latest
8286 environment :
8387 name : pypi
8488 url : https://pypi.org/p/asyncproxy
8589 permissions :
8690 id-token : write
91+ continue-on-error : true
92+ strategy :
93+ matrix :
94+ python-version : ['3.9', '3.11', '3.12']
8795 steps :
88- - uses : actions/checkout@v4
89-
90- - name : Set up Python
91- uses : actions/setup-python@v5
92- with :
93- python-version : ' 3.12'
94-
95- - name : Install dependencies
96- run : |
97- python -m pip install --upgrade pip
98- pip install setuptools wheel
99-
100- - name : build
101- run : python setup.py build sdist
102-
103- - name : Publish package distributions to PyPI
104- uses : pypa/gh-action-pypi-publish@release/v1
96+ - name : Install git
97+ run : |
98+ yum install -y git redhat-lsb-core gnupg2 wget ca-certificates yum-utils jq
99+ yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
100+ yum install -y docker-ce-cli
101+
102+ - uses : actions/checkout@v4
103+
104+ - name : Set up Python
105+ run : sh -x scipts/build/install_depends_yum.sh
106+
107+ - name : Install dependencies
108+ run : sh -x scipts/build/install_depends_wheels.sh
109+
110+ - name : Set up QEMU
111+ uses : docker/setup-qemu-action@v3
112+
113+ - name : Set dynamic environment
114+ id : set-env
115+ run : |
116+ PLATFORMS="`docker manifest inspect ${{ env.BASE_IMAGE }} | \
117+ jq -r '.manifests[] | "\(.platform.os)/\(.platform.architecture)\(if .platform.variant != null then "/\(.platform.variant)" else "" end)"' | \
118+ 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}"
123+ 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
128+
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/
134+
135+ - name : Publish package distributions to PyPI
136+ if : github.event_name == 'release' && github.event.action == 'created'
137+ uses : pypa/gh-action-pypi-publish@release/v1
0 commit comments