Build and Publish to PyPI #806
Workflow file for this run
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: Build and Publish to PyPI | |
# Reference: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | |
on: | |
push: | |
branches: ["**"] | |
create: | |
tags: "**" | |
jobs: | |
acasclient: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup python 3.8 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.8" | |
- name: Install pypa/build and twine | |
run: | | |
python -m pip install build twine --user | |
- name: Build a binary wheel and a source tarball | |
run: | | |
python -m build --sdist --wheel --outdir dist/ . | |
- name: Publish to TestPyPI | |
run: | | |
python -m twine upload --skip-existing -u ${{ secrets.TEST_PYPI_USERNAME }} -p ${{ secrets.TEST_PYPI_PASSWORD }} --repository-url https://test.pypi.org/legacy/ dist/* | |
- name: Publish to PyPI | |
if: startsWith(github.ref, 'refs/tags') | |
run: | | |
python -m twine upload --skip-existing -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} dist/* |