Select Git revision
python-publish.yml
python-publish.yml 2.27 KiB
# This workflow 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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: upload
on:
release:
types: [published]
push:
branches: [ master ]
jobs:
build-wheels:
name: Building on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --only-binary=numpy,scipy numpy scipy wheel
- name: Build wheels
run: python setup.py bdist_wheel
- name: Publish wheels to GitHub artifacts
uses: actions/upload-artifact@v2
with:
name: wheels
path: ./dist/*.whl
publish-pypi:
needs: [build-wheels]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: wheels
path: dist/
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Display Python version
run: python -c "import sys; print(sys.version)"