Skip to content

Update python-package-workflow.yml #4

Update python-package-workflow.yml

Update python-package-workflow.yml #4

name: Python Package Workflow
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r python-package/requirements.txt
- name: Run tests
run: |
cd python-package
python -m unittest discover tests
- name: Upload to PyPI
if: startsWith(github.ref, 'refs/tags/')
run: |
cd python-package
python setup.py sdist bdist_wheel
pip install twine
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}