-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add a stat condition check for uploading release binaries #215
Conversation
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 <jiazho@microsoft.com>
Did this still created a source only release? |
Yes, for |
done | ||
else | ||
echo "No files to upload" | ||
exit 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be exit 1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No we have crates that don't have binaries.
Each tag and release is per crate.
# 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have quotes here around the variables:
gh release upload "${RELEASE_NAME}" "$i"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be ideal factor this out as a script and have shellcheck run on all our scripts.
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.
An instance of the failed run this commits tries to resolve is found here.