Skip to content

Commit

Permalink
fix: add a stat condition check for uploading release binaries
Browse files Browse the repository at this point in the history
This commits adds a check to confirm the existance of files in the release
subdirectories before attempting to upload to GitHub release.
This change helps avoid unnecessary errors in the case where the release
subdirectories are empty

Signed-off-by: jiaxiao zhou <[email protected]>
  • Loading branch information
Mossaka committed Jul 31, 2023
1 parent d02c2c0 commit bc1ddbc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,15 @@ jobs:
- name: Create release
run: |
gh release create ${{ github.ref }} --generate-notes --prerelease
for i in release/*/*; do
gh release upload ${RELEASE_NAME} $i
done
# skip upload if there are no files
if stat release/*/* >/dev/null 2>&1; then
for i in release/*/*; do
gh release upload ${RELEASE_NAME} $i
done
else
echo "No files to upload"
exit 0
fi
env:
GH_TOKEN: ${{ github.token }}
RELEASE_NAME: ${{ needs.generate.outputs.crate }}/${{ needs.generate.outputs.version }}
Expand Down

0 comments on commit bc1ddbc

Please sign in to comment.