Add job to push a package for each new Git tag

This commit is contained in:
Guillaume Klein
2023-03-22 21:01:53 +01:00
parent c910ec0293
commit 33f41d84e3

View File

@@ -60,3 +60,31 @@ jobs:
- name: Run pytest - name: Run pytest
run: | run: |
pytest -v tests/test.py pytest -v tests/test.py
build-and-push-package:
runs-on: ubuntu-latest
needs: [check-code-format, run-tests]
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
pip install wheel
- name: Build package
run: |
python3 setup.py sdist bdist_wheel
- name: Push package on PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}