Skip to content

Build and Publish to PyPI #587

Build and Publish to PyPI

Build and Publish to PyPI #587

Workflow file for this run

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/*