File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -286,16 +286,25 @@ jobs:
286286 GH_TOKEN : ${{ github.token }}
287287 IMAGE_NAME : ${{ matrix.image }}
288288 run : |
289+ set -x
289290 curl -sL "$(curl -sL "https://api.github.com/repos/cli/cli/releases" | grep _linux_amd64.tar.gz | grep https | head -n1 | cut -d'"' -f4)" -o gh.tar.gz \
290291 && tar xzf gh.tar.gz \
291292 && find gh*/ -name gh -exec mv {} /usr/local/bin/ \;
292- git config --global --add safe.directory "$PWD" \
293- && git tag -f ci-latest HEAD \
294- && git push -f origin tag ci-latest
295- find build/ -iname '*.rpm' | while read -r f; do
293+ git config --global --add safe.directory "$PWD"
294+ git tag -f ci-latest HEAD
295+ git push -f origin tag ci-latest
296+ IFS=$'\n'
297+ set +e; assets="$(gh release view ci-latest | grep '^asset:' | cut -f2 | grep -F "${IMAGE_NAME//:/.}")"; set -e
298+ files="$(find build/ -iname '*.rpm')"
299+ for f in $files; do
296300 newf="$IMAGE_NAME-$(basename "$f")"
297301 mv "$f" "$newf"
298302 gh release upload --clobber ci-latest "$newf"
303+ echo gh release upload --clobber ci-latest "$newf"
304+ set +e; assets="$(grep -vF "${newf//:/.}" <<<"$assets")"; set -e
305+ done
306+ for asset in $assets; do
307+ echo gh release delete-asset ci-latest "$asset"
299308 done
300309
301310 - name : Publish RPM packages to GitHub releases (stable)
You can’t perform that action at this time.
0 commit comments