1 2 3 4 5 6 7 8 9 10 11 12
| upload_url=$(curl -s -H "Authorization: token $TOKEN" \ -d '{"tag_name":"'"$ARTIFACTS_BASE_NAME"'", "name":"'"$ARTIFACTS_BASE_NAME"'", "body":"'"$ARTIFACTS_BASE_NAME"'", "target_commitish":"'"$TARGET_BRANCH"'"}' \ "https://api.github.com/repos/$REPO/$TARGET_BRANCH" | jq -r '.upload_url')
upload_url="${upload_url%\{*}"
curl -s -H "Authorization: token $TOKEN" \ -H "Content-Type: application/x-gzip" \ --data-binary @$ARTIFACTS_BASE_NAME.tar.gz \ "$upload_url?name=$ARTIFACTS_BASE_NAME.tar.gz&label=$ARTIFACTS_BASE_NAME.tar.gz"
|