2626env :
2727 BUCKET_NAME : k2go-rootfs
2828 R2_ACCOUNT_ID : ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
29- # Public base that goes into the .meta4 <url>. Path-based route
30- # k2go-download.appdevforall.org/rootfs/* -> k2go-rootfs.
31- ROOTFS_PUBLIC_BASE : ${{ vars.ROOTFS_PUBLIC_BASE || 'https://k2go-download.appdevforall.org/rootfs' }}
29+ # Public base that goes into the .meta4 <url> — where the APK actually downloads the
30+ # rootfs FROM, so it has to name the bucket that holds it. The two buckets are separate
31+ # and so are their names: k2go-download.appdevforall.org serves the APK repo only.
32+ # K2GO-90: this defaulted to k2go-download.appdevforall.org/rootfs, a path-based route that
33+ # was never created. The metalinks published with it resolved to 404 — and since
34+ # --reset-mirrors leaves a single source, there was nothing to fall back to.
35+ ROOTFS_PUBLIC_BASE : ${{ vars.ROOTFS_PUBLIC_BASE || 'https://pub-d64c885cef6c42db8c7925144d73d0ee.r2.dev' }}
3236 # Key prefix inside the bucket. Empty when the route strips /rootfs/ (keys at root);
3337 # set to 'rootfs/' if the route keeps the prefix.
3438 R2_KEY_PREFIX : ${{ vars.ROOTFS_KEY_PREFIX }}
@@ -133,7 +137,7 @@ jobs:
133137
134138 # 1) Big artifacts FIRST (data before any pointer that resolves to them).
135139 shopt -s nullglob
136- for f in iiab-oa_ *.tar.gz; do
140+ for f in k2go_ *.tar.gz; do
137141 echo ">> upload artifact $f"
138142 aws s3 cp "$f" "s3://${BUCKET_NAME}/${PFX}${f}" --endpoint-url "$ENDPOINT"
139143 done
@@ -157,12 +161,12 @@ jobs:
157161
158162 # 4) Prune: keep only the newest $KEEP batches per (tier,arch); delete older + sidecars.
159163 # Only the heavy dated tarballs accumulate (they carry <date>_<sha>); logs and the
160- # TSV overwrite in place, so they never pile up. The prefix filter matches iiab-oa_ *
164+ # TSV overwrite in place, so they never pile up. The prefix filter matches k2go_ *
161165 # only, so proot-distro-v*/ is never touched.
162166 for meta in latest_*_"${ARCH}".meta4; do
163167 base="${meta%.meta4}"; te="${base#latest_}"; tier="${te%_${ARCH}}"
164168 mapfile -t keys < <(aws s3api list-objects-v2 --bucket "$BUCKET_NAME" \
165- --prefix "${PFX}iiab-oa_ " --endpoint-url "$ENDPOINT" \
169+ --prefix "${PFX}k2go_ " --endpoint-url "$ENDPOINT" \
166170 --query "sort_by(Contents,&LastModified)[?contains(Key,'_${tier}_') && ends_with(Key,'_${ARCH}.tar.gz')].Key" \
167171 --output text | tr '\t' '\n' | sed '/^$/d')
168172 n=${#keys[@]}
@@ -174,4 +178,26 @@ jobs:
174178 done
175179 done
176180 fi
181+
182+ # K2GO-377 (TRANSITIONAL — remove before merging). The retention above keeps the
183+ # newest $KEEP k2go_ batches; the pre-rename iiab-oa_ artifacts have no pointer left
184+ # once this tier republished, so they go in full rather than ageing out $KEEP deep at
185+ # ~1.7 GB each. It sits INSIDE this loop on purpose: it only ever touches the tier and
186+ # arch this job just republished, so a tier that failed to build keeps the artifact its
187+ # metalink still names.
188+ #
189+ # Removal is gated on evidence, not on this run finishing. Delete the block only when
190+ # aws s3api list-objects-v2 --bucket "$BUCKET_NAME" --prefix "iiab-oa_" \
191+ # --endpoint-url "$ENDPOINT" --query "length(Contents)" --output text
192+ # reports None/0 — otherwise the leftovers outlive the only code that would clear them.
193+ mapfile -t legacy < <(aws s3api list-objects-v2 --bucket "$BUCKET_NAME" \
194+ --prefix "${PFX}iiab-oa_" --endpoint-url "$ENDPOINT" \
195+ --query "Contents[?contains(Key,'_${tier}_') && ends_with(Key,'_${ARCH}.tar.gz')].Key" \
196+ --output text | tr '\t' '\n' | sed '/^$/d')
197+ for key in "${legacy[@]}"; do
198+ echo ">> sweep legacy $key (+ sidecars)"
199+ for ext in '' .meta4 .sha256 .installed .torrent; do
200+ aws s3 rm "s3://${BUCKET_NAME}/${key}${ext}" --endpoint-url "$ENDPOINT" || true
201+ done
202+ done
177203 done
0 commit comments