Skip to content

Merge pull request #74 from RIPE-NCC/pypi_integration #29

Merge pull request #74 from RIPE-NCC/pypi_integration

Merge pull request #74 from RIPE-NCC/pypi_integration #29

Workflow file for this run

# This workflow runs whenever a new test tag is pushed.
# It will install Python dependencies, run tests and lint with a variety of Python versions
# If tests pass, it will build the package and publish it on test.pypi.org
name: Python package
on:
push:
tags:
- 'test/v*'
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: tox
run: tox
build:
name: Build package for TestPyPI
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build release
run: |
python -m pip install --upgrade build
python -m build
- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/
publish:
name: Publish package to TestPyPI
runs-on: ubuntu-latest
needs: build
steps:
- name: Retrieve dist
uses: actions/download-artifact@v5
with:
name: release-dists
path: dist/
- name: Push to test pypi
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_TEST_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
verbose: true