cloudflare/cloudflare-typescript

Public

mirrored fromhttps://github.com/cloudflare/cloudflare-typescriptAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
f94ee6573d46d54dff06c87266ef3252901e69cd

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

scripts/utils/upload-artifact.sh

25lines · modecode

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