Skip to content

Commit d276edb

Browse files
authored
Merge pull request #23349 from matthewfeickert/ci/remove-old-uploads-to-save-space
CI: Remove old scipy-wheels-nightly uploads to ensure space
2 parents d4548e6 + 5c66fe9 commit d276edb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/nightlies.yml

+20
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,23 @@ jobs:
6363
--user scipy-wheels-nightly \
6464
--skip-existing \
6565
dist/matplotlib-*.whl
66+
67+
- name: Remove old uploads to save space
68+
shell: bash
69+
run: |
70+
N_LATEST_UPLOADS=5
71+
72+
# Remove all _but_ the last "${N_LATEST_UPLOADS}" package versions
73+
# N.B.: `anaconda show` places the newest packages at the bottom of the output
74+
# of the 'Versions' section and package versions are preceded with a ' + '.
75+
anaconda show scipy-wheels-nightly/matplotlib &> >(grep '+') | \
76+
sed 's/.* + //' | \
77+
head --lines "-${N_LATEST_UPLOADS}" > remove-package-versions.txt
78+
79+
if [ -s remove-package-versions.txt ]; then
80+
while LANG=C IFS= read -r package_version ; do
81+
anaconda --token ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} remove \
82+
--force \
83+
"scipy-wheels-nightly/matplotlib/${package_version}"
84+
done <remove-package-versions.txt
85+
fi

0 commit comments

Comments
 (0)