Skip to content

Publish

Publish #161

Workflow file for this run

name: Publish
on:
release:
types: [created]
push:
branches: [dev]
pull_request:
branches: [master]
create:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.7"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest setuptools wheel twine
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Build and test
run: |
python setup.py build sdist bdist_wheel
pytest --disable-warnings
# - name: Test Publish
# uses: pypa/gh-action-pypi-publish@release/v1
# if: github.event_name == 'release' && github.event.action == 'created'
# with:
# user: __token__
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
# repository-url: https://test.pypi.org/legacy/
# skip-existing: true
# verbose: true
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'create' && github.event.ref_type == 'tag'
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip-existing: true
verbose: true