Cleanup Python dev releases #1
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 Python dev releases | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| keep-last: | |
| description: "Number of recent dev releases to keep" | |
| required: false | |
| default: "5" | |
| dry-run: | |
| description: "Only simulate deletions (true/false)" | |
| required: false | |
| default: "true" | |
| jobs: | |
| cleanup: | |
| runs-on: ubuntu-latest | |
| environment: pypi | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Install pypi-cleanup | |
| run: pip install pypi-cleanup | |
| - name: Run pypi-cleanup on TestPyPI | |
| env: | |
| PYPI_API_TOKEN: ${{ secrets.TEST_PYPI_API_TOKEN }} | |
| run: | | |
| cd libnvme | |
| pypi-cleanup \ | |
| --repository-url https://test.pypi.org/legacy/ \ | |
| --package libnvme \ | |
| --keep ${{ github.event.inputs.keep-last }} \ | |
| --version-regex '.*\.dev[0-9]+' \ | |
| $([ "${{ github.event.inputs.dry-run }}" == "true" ] && echo "--dry-run") |