Cleanup PyPI #2
This file contains hidden or 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: Cleanup PyPI | |
| on: | |
| workflow_call: | |
| workflow_dispatch: | |
| inputs: | |
| dry-run: | |
| description: List packages that would be deleted but don't delete them | |
| type: boolean | |
| default: false | |
| jobs: | |
| cleanup_pypi: | |
| name: Remove Nightlies from PyPI | |
| runs-on: ubuntu-latest | |
| env: | |
| PYPI_CLEANUP_PASSWORD: ${{secrets.PYPI_CLEANUP_PASSWORD}} | |
| PYPI_CLEANUP_OTP: ${{secrets.PYPI_CLEANUP_OTP}} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Astral UV | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "0.7.14" | |
| - name: Run Cleanup | |
| run: | | |
| uv venv | |
| uv sync --only-group pypi --no-install-project | |
| uv run --no-sync -s scripts/pypi_cleanup.py ${{ inputs.dry-run && '--dry' || '' }} \ | |
| --index-hostname "${{ vars.PYPI_HOST }}" \ | |
| --username "${{ vars.PYPI_CLEANUP_USERNAME }}" \ | |
| --max-nightlies ${{ vars.PYPI_MAX_NIGHTLIES }} |