3333 os : ["ubuntu-22.04", "ubuntu-20.04", "macos-12"]
3434 platform : ["x86_64"]
3535 python-version : ["3.8", "3.9", "3.10", "3.11"]
36+ env :
37+ PLATFORM_OS : ${{ matrix.os }}
3638
3739 steps :
3840 - name : Checkout repository
@@ -130,9 +132,12 @@ jobs:
130132 sudo mkdir -p $BUILD_TEMP_DIR
131133 sudo chown -R $(id -u):$(id -g) $BUILD_TEMP_DIR
132134 pip install wheel
133- python setup.py bdist_wheel --plat-name=$PLATFORM_TAG
135+ python setup.py bdist_wheel
134136 echo "List wheels"
135137 ls ./dist
138+ find ./dist -type f -name '*.whl' -exec mv {} {}.$PLATFORM_OS \;
139+ echo "Renamed with $PLATFORM_OS suffix"
140+ ls ./dist
136141
137142 - name : Build package for MacOS
138143 if : runner.os == 'macOS'
@@ -144,9 +149,10 @@ jobs:
144149 pip install wheel
145150 python setup.py bdist_wheel
146151
147- - uses : actions/upload-artifact@v3
152+ - name : " Upload artifacts"
153+ uses : actions/upload-artifact@v3
148154 with :
149- path : ./dist/*.whl
155+ path : ./dist/*
150156
151157 test-wheels :
152158 name : Test wheels on ${{ matrix.os }} ${{ matrix.platform }} (Python ${{ matrix.python-version }})
@@ -158,7 +164,7 @@ jobs:
158164 os : ["ubuntu-22.04", "ubuntu-20.04", "macos-12", "macos-11"]
159165 python-version : ["3.8", "3.9", "3.10", "3.11"]
160166 env :
161- PYTHON_VERSION : ${{ matrix.python-version }}
167+ PLATFORM_OS : ${{ matrix.os }}
162168
163169 steps :
164170 - name : Install Ubuntu 22.04 runtime dependencies
@@ -176,7 +182,6 @@ jobs:
176182 libegl1 \
177183 libopengl0 \
178184 xvfb
179- echo "PLATFORM_TAG=ubuntu22_04_x86_64" >> $GITHUB_ENV
180185
181186 - name : Install Ubuntu 20.04 runtime dependencies
182187 if : matrix.os == 'ubuntu-20.04'
@@ -193,7 +198,6 @@ jobs:
193198 libegl1 \
194199 libopengl0 \
195200 xvfb
196- echo "PLATFORM_TAG=ubuntu20_04_x86_64" >> $GITHUB_ENV
197201
198202 - name : Set up Python
199203 uses : actions/setup-python@v4
@@ -208,15 +212,14 @@ jobs:
208212 - name : Install dependencies
209213 shell : bash
210214 run : |
211- echo "PYTHON_SITE_PACKAGES=$pythonLocation/lib/python$PYTHON_VERSION/site-packages" >> $GITHUB_ENV
212215 python -m pip install pytest Pillow numpy pixelmatch python-dotenv
213216
214217 - name : Install and test wheels on Ubuntu
215218 if : runner.os == 'Linux'
216219 run : |
217- python -m pip install --find-links wheelhouse/artifact --platform $PLATFORM_TAG --target $PYTHON_SITE_PACKAGES --no-deps --upgrade pymgl
220+ find ./wheelhouse/artifact -type f -name "*.whl.$PLATFORM_OS" -print0 -exec bash -c 'mv "${0}" "${0//.$PLATFORM_OS/}"' {} \;
221+ python -m pip install --find-links wheelhouse/artifact pymgl
218222 python -m pip list
219- python -m pip list --path $PYTHON_SITE_PACKAGES
220223 xvfb-run -a --server-args="-screen 0 1024x768x24 -ac +render -noreset" \
221224 python -m pytest --pyargs pymgl -v
222225
0 commit comments