Build and Publish #109
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 to PyPI" | |
on: | |
push: | |
branches: [ develop ] | |
tags: [ '*' ] | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: [ develop ] | |
schedule: | |
- cron: '30 22 15 * *' | |
jobs: | |
build-and-publish: | |
name: Build and publish Python distributions to PyPI | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install pypa/build | |
run: | | |
pip install build | |
pip list | |
- name: Build a binary wheel and a source tarball | |
run: python -m build | |
- name: Publish distribution to PyPI | |
if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: pypi-packages | |
path: dist/ |