Merge pull request #12 from liangxiao1/xiliang #130
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
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | |
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#on | |
name: Build test and publish | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: Build wheel and publish | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Python 3.7 | |
uses: actions/setup-python@v1 | |
with: | |
python-version: 3.7 | |
- name: Install and upgrade pip and wheel | |
run: | | |
python -m pip install -U pip wheel --user | |
- name: Install setuptools | |
run: | | |
python -m pip install -U setuptools --user | |
- name: Build a binary wheel and a source tarball | |
run: | | |
python setup.py sdist bdist_wheel | |
- name: Test the wheel installation | |
run: | | |
pip install -U dist/*.whl | |
- name: Publish to PyPI | |
if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.amival_token_pypi }} |