Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #3
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 workflows will upload a Python Package using Twine when a release is created | |
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | |
name: Upload Python Package | |
on: push | |
jobs: | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-18.04, macos-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
# This allows the setuptools_scm library to discover the tag version from git | |
fetch-depth: 0 | |
submodules: 'true' | |
- uses: actions/setup-python@v2 | |
name: Install Python | |
with: | |
python-version: '3.6' | |
- name: Install cibuildwheel | |
run: | | |
python -m pip install cibuildwheel==1.4.2 | |
- name: Build wheels | |
env: | |
#: Build for CPython 3.x | |
CIBW_BUILD: cp3* | |
run: | | |
python -m cibuildwheel --output-dir wheelhouse | |
- name: Check wheel | |
run: | | |
python -m pip install twine | |
twine check wheelhouse/*.whl | |
- uses: actions/upload-artifact@v2 | |
with: | |
path: ./wheelhouse/*.whl | |
build_sdist: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
# This allows the setuptools_scm library to discover the tag version from git | |
fetch-depth: 0 | |
submodules: 'true' | |
- uses: actions/setup-python@v2 | |
name: Install Python | |
with: | |
python-version: '3.6' | |
- name: Build sdist | |
run: | | |
pip install scikit-build | |
python setup.py sdist | |
- name: Check sdist | |
run: | | |
pip install twine | |
twine check dist/*.tar.gz | |
- uses: actions/upload-artifact@v2 | |
with: | |
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') | |
# alternatively, to publish when a GitHub Release is created, use the following rule: | |
# if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- uses: actions/[email protected] | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_PASSWORD }} | |
# To test: repository_url: https://test.pypi.org/legacy/ |