Bump version #16
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: Upload Python Package | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build_and_publish_test: | |
name: Build and publish to test.pypi on commit, and pypi on release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.9" | |
- name: Install pypa/build | |
run: >- | |
python -m | |
pip install | |
build | |
--user | |
- name: Build a binary wheel and a source tarball | |
run: >- | |
python -m | |
build | |
--sdist | |
--wheel | |
--outdir dist/ | |
. | |
- name: Publish package to test.pypi | |
if: ${{ !startsWith(github.ref, 'refs/tags') }} | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
repository_url: https://test.pypi.org/legacy/ | |
- name: Publish package to pypi if commit is release | |
if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} |