-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create and upload binaries to the release tag through an automated sc…
…ript Signed-off-by: shams <shamsazeem20@gmail.com>
- Loading branch information
1 parent
d89acaa
commit 34b525f
Showing
5 changed files
with
75 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
BINARY_FILE_NAME=$1 | ||
|
||
echo "---" | ||
echo "Looking for old asset file on repo..." | ||
RELEASE_DATA=$(curl -s -X GET https://api.github.com/repos/KonduitAI/konduit-serving/releases/25710929) | ||
|
||
id=" " | ||
eval "$(echo "${RELEASE_DATA}" | grep -C2 "name.:.\+""${BINARY_FILE_NAME}""" | grep -m 1 "id.:" | grep -w id | tr : = | tr -cd '[[:alnum:]]=')" | ||
echo "---" | ||
if [ "${id}" = " " ]; then | ||
echo "No old asset file found with the same file name." | ||
else | ||
echo "Deleting old asset file..." | ||
curl -s -u "$(cat ~/TOKEN)" -X "DELETE" "https://api.github.com/repos/KonduitAI/konduit-serving/releases/assets/""${id}""" | ||
echo "Old asset file deleted..." | ||
fi | ||
|
||
echo "---" | ||
echo "Uploading ${BINARY_FILE_NAME}" | ||
curl -u "$(cat ~/TOKEN)" --data-binary @builds/""${BINARY_FILE_NAME}"" -H "Content-Type:application/octet-stream" -X POST "https://uploads.github.com/repos/KonduitAI/konduit-serving/releases/25710929/assets?name=""${BINARY_FILE_NAME}""" | ||
echo "---" | ||
echo "Uploaded ""${BINARY_FILE_NAME}"" at URL: ${UPLOAD_URL}" |