Merge pull request #428 from vtnate/pessimistic-versions #85
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
name: Publish Python 🐍 distributions 📦 to TestPyPI and PyPI | |
on: push | |
jobs: | |
build-n-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 dependencies—pandoc | |
run: | | |
# pandoc | |
downloadUrl="https://github.com/jgm/pandoc/releases/download/2.19.2/pandoc-2.19.2-1-amd64.deb" | |
wget --quiet "$downloadUrl" | |
sudo dpkg -i "${downloadUrl##*/}" | |
- name: Install pypandoc | |
run: python -m pip install pypandoc | |
- name: Build a binary wheel and a source tarball | |
run: | | |
python -m pip install wheel | |
python setup.py sdist bdist_wheel | |
- name: Publish distribution 📦 to Test PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
skip_existing: true | |
- name: Publish distribution 📦 to PyPI | |
if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |