Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
Jess Frazelle 2018-09-24 19:37:37 -04:00
parent 0ee7b3e78a
commit ef0a7f463f
No known key found for this signature in database
GPG Key ID: 18F3685C0022BFF3
3 changed files with 10 additions and 9 deletions

View File

@ -5,4 +5,4 @@
services: services:
- docker - docker
script: script:
- ./test.sh - make test

View File

@ -37,8 +37,8 @@ main(){
# Get the tags. # Get the tags.
tag_response=$(curl -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${GITHUB_REPOSITORY}/tags") tag_response=$(curl -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${GITHUB_REPOSITORY}/tags")
tag_name=$(echo $tag_response | jq -e --raw-output .[0].name) tag_name=$(echo "$tag_response" | jq -e --raw-output .[0].name)
tag_id=$(echo $tag_response | jq -e --raw-output .[0].id) tag_id=$(echo "$tag_response" | jq -e --raw-output .[0].id)
# Get the latest release. # Get the latest release.
latest_response=$(curl -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${GITHUB_REPOSITORY}/releases/latest") latest_response=$(curl -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${GITHUB_REPOSITORY}/releases/latest")
@ -48,18 +48,18 @@ main(){
if [[ "$tag_name" != "$latest_release" ]]; then if [[ "$tag_name" != "$latest_release" ]]; then
# Create the release. # Create the release.
echo "Creating release for tag name: ${tag_name}" echo "Creating release for tag name: ${tag_name}"
response=$(curl -XPOST -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${GITHUB_REPOSITORY}/release" --data '{"tag_name": "'${tag_name}'","name":"'${tag_name}'","draft":false,"prerelease":false}') response=$(curl -XPOST -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${GITHUB_REPOSITORY}/release" --data '{"tag_name": "'"${tag_name}"'","name":"'"${tag_name}"'","draft":false,"prerelease":false}')
release_id=$(echo $response | jq -e --raw-output .id) release_id=$(echo "$response" | jq -e --raw-output .id)
fi fi
# Upload the files. # Upload the files.
echo "Uploading files: ${files[@]}" echo "Uploading files: ${files[*]}"
echo "For tag name: ${tag_name} tag id: ${tag_id}" echo "For tag name: ${tag_name} tag id: ${tag_id}"
for file in ${files[@]}; do for file in "${files[@]}"; do
filename=$(basename "$file") filename=$(basename "$file")
curl -XPOST -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" \ curl -XPOST -sSL -H "${AUTH_HEADER}" \
--data-binary @"$file" \ --data-binary @"$file" \
-H "Content-Type: application/octet-stream" \ -H "Content-Type: application/octet-stream" \
"https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${release_id}/assets?name=${filename}" "https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${release_id}/assets?name=${filename}"
@ -70,4 +70,4 @@ main(){
echo "Uploading assets to ${tag_name} complete!" echo "Uploading assets to ${tag_name} complete!"
} }
main $@ main "$@"

View File

@ -27,4 +27,5 @@ fi
PROPERTIES="$PROPERTIES --jvm_flag=-Dcom.google.gitiles.sourcePath=$ROOT" PROPERTIES="$PROPERTIES --jvm_flag=-Dcom.google.gitiles.sourcePath=$ROOT"
# shellcheck disable=SC2086
exec "${ROOT}/bin/gitiles-dev/dev" $PROPERTIES exec "${ROOT}/bin/gitiles-dev/dev" $PROPERTIES