Skip to content

add actions

add actions #4

name: Build and Publish to PyPI
on:
push:
branches:
- main
tags:
- 'v*'
jobs:
build-and-publish:
name: Build and Publish to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine cython numpy
- name: Build Source distribution
run: |
python setup.py sdist
- uses: actions/upload-artifact@v2
with:
name: sdist
path: dist/*.tar.gz
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: dist