BUILD: add additional wheels #30
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Wheels | |
on: | |
push: | |
branches: [ main ] | |
tags: [ v* ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: RalfG/python-wheels-manylinux-build@v0.4.2 | |
with: | |
python-versions: 'cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311' | |
build-requirements: 'cython numpy' | |
pip-wheel-args: '-v --wheel-dir=wheelhouse --no-deps' | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheelhouse | |
path: wheelhouse | |
build-other: | |
# runs-on: macos-latest | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows-latest, macos-latest] | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip wheel setuptools | |
python -m pip install cython oldest-supported-numpy | |
- name: Build wheel | |
run: | | |
python -m pip wheel -v --wheel-dir=wheel --no-deps . | |
- name: Fix wheel (Mac OS) | |
if: matrix.os == 'macos-latest' | |
run: | | |
python -m pip install delocate | |
delocate-wheel -v -w wheelhouse wheel/cached_interpolate*.whl | |
- name: Fix wheel (Windows) | |
if: matrix.os == 'windows-latest' | |
run: | | |
python -m pip install delvewheel | |
for %w in (wheel\*.whl) do delvewheel repair -v --wheel-dir wheelhouse %w | |
- name: Remove temporary wheels and install | |
run: | | |
rm -rf wheel/build/ | |
cd wheelhouse | |
python -m pip install -v * | |
- name: Run import tests | |
run: | | |
cd ../ | |
python -c "import cached_interpolate" | |
python -c "import cached_interpolate.build" | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: wheelhouse | |
path: wheelhouse | |
build-dist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools | |
python -m pip install numpy cython | |
- name: Build package | |
run: | | |
python setup.py sdist --verbose | |
python -m pip install --debug -vv dist/* | |
cd ../ | |
python -c "import cached_interpolate" | |
python -c "import cached_interpolate.build" | |
cd - | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [ build-linux, build-other, build-dist ] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
# - name: Install dependencies | |
# run: | | |
# python -m pip install --upgrade pip setuptools | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheelhouse | |
path: dist | |
- name: Download artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
path: dist | |
- name: Gather artifacts | |
run: | | |
ls | |
# mv wheelhouse/* dist/ | |
ls dist | |
rm dist/*-linux_x86_64.whl | |
# - name: Publish test package | |
# if: github.event_name == 'push' | |
# uses: pypa/gh-action-pypi-publish@master | |
# with: | |
# user: __token__ | |
# password: ${{ secrets.TRUE_PYPI_API_TOKEN }} | |
# repository_url: https://test.pypi.org/legacy/ | |
# skip_existing: true | |
- name: Publish package | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
skip_existing: true |