Debian Codegraph @

.github/workflows/cleanup-python.yml

raw
1 name: cleanup python
2
3 on:
4 workflow_dispatch:
5 inputs:
6 keep-last:
7 description: "How many recent dev releases to keep"
8 required: false
9 default: "5"
10 dry-run:
11 description: "Only simulate the deletion (true/false)"
12 required: false
13 default: "true"
14
15 jobs:
16 cleanup:
17 runs-on: ubuntu-latest
18 environment: pypi
19 steps:
20 - name: Install pypi-cleanup
21 run: pip install pypi-cleanup
22
23 - name: Run pypi-cleanup on TestPyPI
24 env:
25 PYPI_USERNAME: __token__
26 PYPI_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
27 run: |
28 pypi-cleanup \
29 --username "$PYPI_USERNAME" \
30 --password "$PYPI_PASSWORD" \
31 --repository-url https://test.pypi.org/legacy/ \
32 --package libnvme \
33 --keep ${{ github.event.inputs.keep-last }} \
34 --version-regex '.*\.dev[0-9]+' \
35 $([ "${{ github.event.inputs.dry-run }}" == "true" ] && echo "--dry-run")