50 lines
1.2 KiB
YAML
50 lines
1.2 KiB
YAML
name: PyPI Auto Publish
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
testOnly:
|
|
description: 'Only publish to test.pypi.org'
|
|
required: false
|
|
type: boolean
|
|
push:
|
|
paths:
|
|
- 'setup.py'
|
|
|
|
jobs:
|
|
pypi-publish:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.7
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --user --upgrade setuptools wheel
|
|
|
|
- name: Build
|
|
run: |
|
|
python setup.py sdist bdist_wheel
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: dist
|
|
path: dist/
|
|
|
|
# Not publishing to test just yet
|
|
#- name: Publish a Python distribution to PyPI
|
|
# uses: pypa/gh-action-pypi-publish@release/v1
|
|
# with:
|
|
# user: __token__
|
|
# password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
|
# repository_url: https://test.pypi.org/legacy/
|
|
|
|
- name: Publish a Python distribution to PyPI
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
with:
|
|
user: __token__
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
|