Lecture-13 / .github /workflows /python-publish.yml
bluemellophone's picture
Initial commit
8ee14ff unverified
name: Wheel
# Build on every branch push, tag push, and pull request change:
on: push
jobs:
build_wheels:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.8]
steps:
- uses: actions/checkout@v2
with:
# This allows the setuptools_scm library to discover the tag version from git
fetch-depth: 0
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: ${{ matrix.python-version }}
- name: Build wheel
run: |
pip install --upgrade pip
pip install build
python -m build --wheel --outdir dist/ .
- uses: actions/upload-artifact@v2
with:
path: ./dist/*.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.8'
- name: Build sdist
run: |
pip install --upgrade pip
pip install build
python -m build --sdist --outdir dist/ .
- 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')
# steps:
# - uses: actions/download-artifact@v2
# 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/