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: Tests and push to PyPi and DockerHub | |
on: push | |
jobs: | |
push_to_pypi: | |
name: Push to PyPi | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Build and push the release | |
run: >- | |
python setup.py sdist | |
# All the tags go to PyPI test | |
- name: Publish distribution to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
# Only non-alpha releases go to the official PyPi | |
- name: Publish distribution to PyPI (official release) | |
if: contains(github.ref, 'alpha') != true | |
uses: pypa/gh-action-pypi-publish@master |