Skip to content

Commit 8b4a9ac

Browse files
committed
build: add cleanup task for pypi test uploads
Be nice with upstream and remove old test uploads. Signed-off-by: Daniel Wagner <wagi@kernel.org>
1 parent 74d7217 commit 8b4a9ac

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Cleanup dev versions on TestPyPI
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+
--project libnvme \
33+
--keep ${{ github.event.inputs.keep-last }} \
34+
--version-regex '.*\.dev[0-9]+' \
35+
$([ "${{ github.event.inputs.dry-run }}" == "true" ] && echo "--dry-run")

0 commit comments

Comments
 (0)