Skip to content

Commit c9ee601

Browse files
committed
fix(ci): prune stale devel wheel assets
1 parent 821b7a8 commit c9ee601

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/release-dev.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,31 @@ jobs:
422422
git tag -fa devel -m "Latest Devel" "${GITHUB_SHA}"
423423
git push --force origin devel
424424
425+
- name: Prune stale wheel assets from devel release
426+
env:
427+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
428+
WHEEL_VERSION: ${{ needs.build-python-wheels.outputs.wheel_version }}
429+
run: |
430+
set -euo pipefail
431+
CURRENT_PREFIX="openshell-${WHEEL_VERSION}-"
432+
433+
if ! gh release view devel --repo "${GITHUB_REPOSITORY}" --json assets > /dev/null 2>&1; then
434+
echo "No existing devel release found; skipping wheel pruning."
435+
exit 0
436+
fi
437+
438+
gh release view devel --repo "${GITHUB_REPOSITORY}" --json assets --jq '.assets[].name' \
439+
| while read -r asset; do
440+
case "$asset" in
441+
*.whl)
442+
if [[ "$asset" != "${CURRENT_PREFIX}"* ]]; then
443+
echo "Deleting stale wheel asset: $asset"
444+
gh release delete-asset devel "$asset" --repo "${GITHUB_REPOSITORY}" --yes
445+
fi
446+
;;
447+
esac
448+
done
449+
425450
- name: Create / update GitHub Release
426451
uses: softprops/action-gh-release@v2
427452
with:

0 commit comments

Comments
 (0)