Skip to content
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

Merged
merged 1 commit into from
Jul 31, 2023

Conversation

Mossaka
Copy link
Member

@Mossaka Mossaka commented Jul 31, 2023

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.

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>
@Mossaka Mossaka requested a review from cpuguy83 July 31, 2023 21:16
@Mossaka Mossaka merged commit 71df77d into containerd:main Jul 31, 2023
7 checks passed
@Mossaka Mossaka deleted the fix-release branch July 31, 2023 21:25
@jprendes
Copy link
Collaborator

Did this still created a source only release?

@Mossaka
Copy link
Member Author

Mossaka commented Jul 31, 2023

Yes, for containerd-shim-wasm. I also triggered release for containerd-shim-wasmtime and containerd-shim-wasmedge and they are expected to have binaries.

done
else
echo "No files to upload"
exit 0
Copy link
Collaborator

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?

Copy link
Member

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
Copy link
Contributor

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"

Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants