You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: Remove redundant PyPI publishing jobs from ci.yml (issue #20) (#38)
The ci.yml workflow contained duplicate PyPI publishing functionality that
is already handled by the dedicated release.yml workflow. This commit removes:
- The 'publish' job that published to production PyPI on tag pushes
- The 'test-pypi-publish' job that published to TestPyPI on main branch pushes
These jobs created maintenance overhead and potential confusion about which
workflow handles releases. The release.yml workflow remains the single source
of truth for all release and publishing activities.
Impact:
- Reduced ci.yml from 763 lines to 465 lines (298 lines removed)
- Eliminated duplicate build/validation/publish logic
- Clarified that release.yml is the authoritative release pipeline
- CI workflow now focuses solely on testing and validation
All existing CI functionality (linting, testing, security scanning, building,
integration tests, cross-platform tests, and performance tests) remains intact.
Fixes#20
Co-authored-by: Andreas Florath <Andreas.Florath@telekom.de>
fetch-depth: 0# Fetch all history for version validation
461
-
462
-
- name: Set up Python 3.11
463
-
uses: actions/setup-python@v5
464
-
with:
465
-
python-version: "3.11"
466
-
467
-
- name: Install dependencies
468
-
run: |
469
-
python -m pip install --upgrade pip
470
-
pip install build twine packaging
471
-
472
-
- name: Validate version format
473
-
run: |
474
-
python -c "
475
-
import re
476
-
import sys
477
-
from pathlib import Path
478
-
479
-
# Read version from pyproject.toml
480
-
content = Path('pyproject.toml').read_text()
481
-
match = re.search(r'version = \"(.+?)\"', content)
482
-
if not match:
483
-
print('ERROR: Could not find version in pyproject.toml')
484
-
sys.exit(1)
485
-
486
-
version = match.group(1)
487
-
print(f'Found version: {version}')
488
-
489
-
# Validate version format (PEP 440)
490
-
if not re.match(r'^\d+\.\d+\.\d+(?:\.(?:dev|alpha|beta|rc)\d+)?$', version):
491
-
print(f'ERROR: Version {version} does not match PEP 440 format')
492
-
print('Expected format: X.Y.Z or X.Y.Z.devN or X.Y.Z.alphaN, etc.')
493
-
sys.exit(1)
494
-
495
-
print(f'✓ Version {version} is valid')
496
-
"
497
-
498
-
- name: Build package
499
-
run: |
500
-
python -m build
501
-
502
-
- name: Check package
503
-
run: |
504
-
twine check dist/*
505
-
506
-
- name: Test installation from built package
507
-
run: |
508
-
# Create a temporary virtual environment
509
-
python -m venv test_env
510
-
source test_env/bin/activate
511
-
512
-
# Install the built wheel
513
-
pip install dist/*.whl
514
-
515
-
# Test that the CLI is available
516
-
aletheia-probe --help
517
-
518
-
# Cleanup
519
-
deactivate
520
-
rm -rf test_env
521
-
522
-
- name: Publish to TestPyPI
523
-
if: success()
524
-
env:
525
-
TWINE_USERNAME: __token__
526
-
TWINE_PASSWORD: ${{ secrets.TESTPYPI_API_TOKEN }}
527
-
run: |
528
-
echo "Publishing to TestPyPI..."
529
-
twine upload --repository testpypi dist/* --verbose || echo "Note: Upload may fail if version already exists on TestPyPI"
530
-
531
-
- name: Test installation from TestPyPI
532
-
if: success()
533
-
run: |
534
-
echo "Waiting 30 seconds for TestPyPI to process the upload..."
535
-
sleep 30
536
-
537
-
# Create a fresh virtual environment
538
-
python -m venv testpypi_env
539
-
source testpypi_env/bin/activate
540
-
541
-
# Try to install from TestPyPI
542
-
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ aletheia-probe || echo "Installation from TestPyPI may fail if package was just uploaded"
0 commit comments