Skip to content

Commit 03c7e50

Browse files
committed
...
1 parent 2ec8a1e commit 03c7e50

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

.github/workflows/packages.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)