@@ -76,120 +76,14 @@ jobs:
7676 shell : bash
7777
7878 build_bin_wheels :
79- needs : build_and_test_python
80- runs-on : ubuntu-latest
8179 permissions :
8280 packages : write
83- env :
84- PY_VER : ${{ matrix.python-version }}
85- BASE_IMAGE : quay.io/pypa/manylinux_${{ matrix.mnl-version }}:latest
86- GHCR_REPO : ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}
87- strategy :
88- fail-fast : false
89- matrix :
90- python-version : ['3.8', '3.9', '3.10', '3.11', '3.12']
91- mnl-version : ['2_28', '2_34']
92- steps :
93- - name : Set up Python ${{ env.PY_VER }}
94- uses : actions/setup-python@v5
95- with :
96- python-version : ${{ env.PY_VER }}
97-
98- - uses : actions/checkout@v4
99-
100- - name : Set up QEMU
101- uses : docker/setup-qemu-action@v3
102-
103- - name : Set up Docker Buildx
104- uses : docker/setup-buildx-action@v3
105-
106- - name : Login to GitHub Container Registry
107- uses : docker/login-action@v3
108- if : github.event_name != 'pull_request'
109- with :
110- registry : ghcr.io
111- username : ${{ github.repository_owner }}
112- password : ${{ secrets.GITHUB_TOKEN }}
113-
114- - name : Set dynamic environment
115- id : set-env
116- run : |
117- PLATFORMS="`docker manifest inspect ${{ env.BASE_IMAGE }} | \
118- jq -r '.manifests[] | "\(.platform.os)/\(.platform.architecture)\(if .platform.variant != null then "/\(.platform.variant)" else "" end)"' | \
119- sort -u | grep -v unknown | paste -sd ','`"
120- GIT_BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}"
121- GIT_BRANCH="${GIT_BRANCH#refs/tags/}"
122- BUILD_IMAGE="${GHCR_REPO}:${GIT_BRANCH}-py${PY_VER}-mnl${{ matrix.mnl-version }}"
123- test "${{ github.event_name }}" != 'pull_request' && \
124- CACHE_SPEC="type=registry,ref=${BUILD_IMAGE}-buildcache" || \
125- CACHE_SPEC="gha"
126- echo "Platforms: ${PLATFORMS}"
127- echo "Build Image: ${BUILD_IMAGE}"
128- echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
129- echo "CACHE_SPEC=${CACHE_SPEC}" >> $GITHUB_ENV
130-
131- - name : Build Binary Wheels
132- uses : docker/build-push-action@v6
133- with :
134- context : .
135- file : ./docker/Dockerfile.python_wheels
136- build-args : |
137- BASE_IMAGE=${{ env.BASE_IMAGE }}
138- PY_VER=${{ env.PY_VER }}
139- platforms : ${{ env.PLATFORMS }}
140- push : false
141- outputs : type=local,dest=dist_out
142- cache-from : ${{ env.CACHE_SPEC }}
143- cache-to : ${{ env.CACHE_SPEC }},mode=max
144-
145- - name : Collect Wheels
146- run : |
147- mkdir dist
148- mv `find dist_out -type f -name \*.whl` dist
149- rm -r dist_out
150-
151- - name : Upload built wheels
152- uses : actions/upload-artifact@v4
153- with :
154- name : dist-py${{ env.PY_VER }}-mnl${{ matrix.mnl-version }}
155- path : dist
81+ needs : build_and_test_python
82+ uses : sippy/libasyncproxy/.github/workflows/BuildPythonWheels.yml@wip
15683
15784 publish_pypi :
15885 needs : build_bin_wheels
159- runs-on : ubuntu-latest
160- environment :
161- name : pypi
162- url : https://pypi.org/p/asyncproxy
16386 permissions :
164- id-token : write
16587 actions : read
16688 contents : read
167- steps :
168- - uses : actions/checkout@v4
169-
170- - name : Download all wheel artifacts
171- uses : actions/download-artifact@v4
172- with :
173- path : dist
174- pattern : dist-*
175- merge-multiple : true
176-
177- - name : Set up Python
178- uses : actions/setup-python@v5
179- with :
180- python-version : ' 3.x'
181-
182- - name : Install dependencies
183- run : |
184- python -m pip install --upgrade pip
185- pip install --upgrade build setuptools wheel
186-
187- - name : build
188- run : python setup.py build sdist
189-
190- - name : Show context tree
191- run : ls -lR dist
192-
193- - name : Publish package distributions to PyPI
194- if : github.event_name == 'release' && github.event.action == 'created'
195- uses : pypa/gh-action-pypi-publish@release/v1
89+ uses : sippy/libasyncproxy/.github/workflows/PublishWheels.yml@wip
0 commit comments