openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
scripts/utils/upload-artifact.sh
25lines · modeblame
98925cefstainless-app[bot]1 years ago | 1 | #!/usr/bin/env bash |
| 2 | set -exuo pipefail | |
| 3 | | |
| 4 | RESPONSE=$(curl -X POST "$URL" \ | |
| 5 | -H "Authorization: Bearer $AUTH" \ | |
| 6 | -H "Content-Type: application/json") | |
| 7 | | |
| 8 | SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url') | |
| 9 | | |
| 10 | if [[ "$SIGNED_URL" == "null" ]]; then | |
| 11 | echo -e "\033[31mFailed to get signed URL.\033[0m" | |
| 12 | exit 1 | |
| 13 | fi | |
| 14 | | |
| 15 | UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \ | |
| 16 | -H "Content-Type: application/gzip" \ | |
| 17 | --data-binary @- "$SIGNED_URL" 2>&1) | |
| 18 | | |
| 19 | if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then | |
| 20 | echo -e "\033[32mUploaded build to Stainless storage.\033[0m" | |
1701df19stainless-app[bot]1 years ago | 21 | echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/openai-python/$SHA'\033[0m" |
98925cefstainless-app[bot]1 years ago | 22 | else |
| 23 | echo -e "\033[31mFailed to upload artifact.\033[0m" | |
| 24 | exit 1 | |
| 25 | fi |