Skip to content

Commit eb22e9b

Browse files
committed
Update build.yml
1 parent 3bb1446 commit eb22e9b

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,30 @@ jobs:
8282
echo "This file is for version checking purposes only. Get the correct zip file for your platform in the release assets." > README.txt
8383
zip -r git-hash_${{ env.DATE_OLD }}-${{ env.SHA_SHORT }}.zip README.txt
8484
85+
- name: Remove all assets from latest release
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88+
run: |
89+
assets=$(gh release view latest --json assets -q '.assets[].name' || true)
90+
91+
if [[ -z "$assets" ]]; then
92+
echo "No assets found on release 'latest'"
93+
exit 0
94+
fi
95+
96+
for asset in $assets; do
97+
echo "Deleting asset: $asset"
98+
gh release delete-asset latest "$asset" -y
99+
done
100+
85101
- name: Update latest release
86-
uses: pyTooling/Actions/[email protected]
87-
with:
88-
tag: latest
89-
rm: true
90-
token: ${{ secrets.GITHUB_TOKEN }}
91-
files: |
92-
git-hash_${{ env.DATE_OLD }}-${{ env.SHA_SHORT }}.zip
93-
${{ github.event.repository.name }}_complete_v${{ env.DATE }}.${{ env.COUNT }}.zip
94-
${{ github.event.repository.name }}_macos_v${{ env.DATE }}.${{ env.COUNT }}.zip
95-
${{ github.event.repository.name }}_linux_arm64_v${{ env.DATE }}.${{ env.COUNT }}.zip
96-
${{ github.event.repository.name }}_linux_x86_64_v${{ env.DATE }}.${{ env.COUNT }}.zip
102+
env:
103+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104+
run: |
105+
gh release upload latest \
106+
git-hash_${{ env.DATE_OLD }}-${{ env.SHA_SHORT }}.zip \
107+
${{ github.event.repository.name }}_complete_v${{ env.DATE }}.${{ env.COUNT }}.zip \
108+
${{ github.event.repository.name }}_macos_v${{ env.DATE }}.${{ env.COUNT }}.zip \
109+
${{ github.event.repository.name }}_linux_arm64_v${{ env.DATE }}.${{ env.COUNT }}.zip \
110+
${{ github.event.repository.name }}_linux_x86_64_v${{ env.DATE }}.${{ env.COUNT }}.zip \
111+
--clobber -R ${{ github.repository }}

0 commit comments

Comments
 (0)