Add GitHub Action for publishing the extension CLI (#9542)
This PR adds a GitHub Action for publishing the extension CLI. When the `extension-cli` tag is pushed, this Action will run, build the `zed-extension` binary, and upload it to DigitalOcean for consumption. This will allow us to consume the pre-built binary in the CI for the extensions repo. Release Notes: - N/A --------- Co-authored-by: Max <max@zed.dev>
This commit is contained in:
parent
2ea333fff6
commit
905a24079a
5 changed files with 102 additions and 56 deletions
33
script/lib/blob-store.sh
Normal file
33
script/lib/blob-store.sh
Normal file
|
@ -0,0 +1,33 @@
|
|||
function upload_to_blob_store_with_acl
|
||||
{
|
||||
bucket_name="$1"
|
||||
file_to_upload="$2"
|
||||
blob_store_key="$3"
|
||||
acl="$4"
|
||||
|
||||
date=$(date +"%a, %d %b %Y %T %z")
|
||||
acl="x-amz-acl:public-read"
|
||||
content_type="application/octet-stream"
|
||||
storage_type="x-amz-storage-class:STANDARD"
|
||||
string="PUT\n\n${content_type}\n${date}\n${acl}\n${storage_type}\n/${bucket_name}/${blob_store_key}"
|
||||
signature=$(echo -en "${string}" | openssl sha1 -hmac "${DIGITALOCEAN_SPACES_SECRET_KEY}" -binary | base64)
|
||||
|
||||
curl --fail -vv -s -X PUT -T "$file_to_upload" \
|
||||
-H "Host: ${bucket_name}.nyc3.digitaloceanspaces.com" \
|
||||
-H "Date: $date" \
|
||||
-H "Content-Type: $content_type" \
|
||||
-H "$storage_type" \
|
||||
-H "$acl" \
|
||||
-H "Authorization: AWS ${DIGITALOCEAN_SPACES_ACCESS_KEY}:$signature" \
|
||||
"https://${bucket_name}.nyc3.digitaloceanspaces.com/${blob_store_key}"
|
||||
}
|
||||
|
||||
function upload_to_blob_store_public
|
||||
{
|
||||
upload_to_blob_store_with_acl $1 $2 $3 "x-amz-acl:public-read"
|
||||
}
|
||||
|
||||
function upload_to_blob_store
|
||||
{
|
||||
upload_to_blob_store_with_acl $1 $2 $3 "x-amz-acl:private"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue