File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
set -euo pipefail
3
3
4
+ # Number of wheel versions to retain on nightly branch
5
+ NIGHTLY_LOOKBACK=10
6
+
4
7
echo " Cleaning up old wheels in Cloudflare R2..."
5
8
6
9
branch_name=" ${GITHUB_REF_NAME} " # Get the current branch
@@ -80,11 +83,11 @@ if [[ "$branch_name" == "nightly" ]]; then
80
83
versions=$( echo " $matching_files " | sed -E " s/^.+-[0-9]+\.[0-9]+\.[0-9]+a([0-9]{8})-.+\.whl$/\1/" | sort -n)
81
84
echo " Unique versions (dates) for platform: $versions "
82
85
83
- # Retain only the last 3 versions
84
- versions_to_keep=$( echo " $versions " | tail -n 3 )
86
+ # Retain only the wheels in the lookback
87
+ versions_to_keep=$( echo " $versions " | tail -n $NIGHTLY_LOOKBACK )
85
88
echo " Versions to keep: $versions_to_keep "
86
89
87
- # Delete files not in the last 3 versions
90
+ # Delete files outside lookback
88
91
for file in $matching_files ; do
89
92
file_version=$( echo " $file " | sed -E " s/^.+-[0-9]+\.[0-9]+\.[0-9]+a([0-9]{8})-.+\.whl$/\1/" )
90
93
if echo " $versions_to_keep " | grep -qx " $file_version " ; then
You can’t perform that action at this time.
0 commit comments