Skip to content

PyDebFlow v0.1.0 - Initial Release #1

PyDebFlow v0.1.0 - Initial Release

PyDebFlow v0.1.0 - Initial Release #1

Workflow file for this run

name: Publish to PyPI
on:
release:
types: [published]
workflow_dispatch:
jobs:
# =========================================================================
# Job 1: Run ALL tests (including API tests)
# =========================================================================
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true # Stop immediately if any test fails
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- 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
pip install -r requirements.txt
pip install pytest pytest-cov
- name: Run ALL tests (library, API, scripts, integration)
run: |
python -m pytest tests/ -v --tb=short
- name: Verify package imports
run: |
python -c "from src.core.flow_model import TwoPhaseFlowModel; print('Import OK')"
# =========================================================================
# Job 2: Build the package (only if ALL tests pass)
# =========================================================================
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Verify package
run: twine check dist/*
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
# =========================================================================
# Job 3: Publish directly to PyPI (no TestPyPI)
# =========================================================================
publish:
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pydebflow
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}