Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #21
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
name: Build, test, and upload to PyPI | |
# Build on every branch push, tag push, and pull request change: | |
on: [push, pull_request] | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-18.04, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
name: Install Python | |
with: | |
python-version: '3.7' | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install cibuildwheel==1.6.4 | |
- name: Build and test wheels | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
env: | |
# PyPy on MacOS (mainly due to MacOS numpy bugs) is unsupported. | |
CIBW_SKIP: "pp*-macosx_x86_64" | |
# Only Python 3.5+ is supported. | |
CIBW_BUILD: "cp3?-* pp3?-*" | |
# Perform tests on each wheel build | |
CIBW_BEFORE_TEST: pip install -r requirements_dev.txt | |
CIBW_TEST_COMMAND: "pytest {project}/tests" | |
- name: Check wheels | |
run: | | |
ls wheelhouse | |
- uses: actions/upload-artifact@v2 | |
with: | |
# Uploaded to a dist artifact folder | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
name: Install Python | |
with: | |
python-version: '3.7' | |
- name: Install sdist requirements | |
run: | | |
python -m pip install -r requirements_sdist.txt | |
- name: Build sdist | |
run: python setup.py sdist | |
- uses: actions/upload-artifact@v2 | |
with: | |
# Uploaded to a dist artifact folder | |
path: dist/*.tar.gz | |
upload_pypi: | |
needs: [build_wheels, build_sdist] | |
runs-on: ubuntu-latest | |
# upload to PyPI on every tag starting with 'v' | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/[email protected] | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/[email protected] | |
with: | |
# https://github.com/pypa/gh-action-pypi-publish | |
user: __token__ | |
# Secrets need to be created on the settings page of the project on GitHub. | |
password: ${{ secrets.pypi_password }} |