diff options
Diffstat (limited to '.github/workflows/python.yml')
-rw-r--r-- | .github/workflows/python.yml | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index ddb929b..f75c9d6 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -15,7 +15,8 @@ on: - ".github/workflows/python.yml" jobs: - build: + build-and-test: + name: Build and Test (Python) runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -34,3 +35,26 @@ jobs: run: python -m build - name: Test run: python -m unittest discover -s src/locusts-r-us + + publish: + name: Publish to PyPI + needs: build-and-test + if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }} + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install dependencies + run: python -m pip install -r requirements.txt + - name: Build the package + run: python -m build --sdist --wheel + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 |