Skip to content

Commit

Permalink
Fix upload.sh for the case tag ci-build non-existing.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengtmartensson committed Mar 19, 2024
1 parent 6a0e0f5 commit 5874c2b
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions common/scripts/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,37 +106,38 @@ if [ "$TRAVIS_COMMIT" != "$tag_sha" ] ; then
curl -XDELETE \
--header "Authorization: token ${GITHUB_TOKEN}" \
"${delete_url}"
fi # if [ "$TRAVIS_COMMIT" != "$tag_sha" ]

echo "Create release..."
echo "Create release..."

if [ -z "$TRAVIS_BRANCH" ] ; then
TRAVIS_BRANCH="master"
fi
if [ -z "$TRAVIS_BRANCH" ] ; then
TRAVIS_BRANCH="master"
fi

# if [ ! -z "$TRAVIS_JOB_ID" ] ; then
# BODY="Travis CI build log: https://travis-ci.org/$REPO_SLUG/builds/$TRAVIS_BUILD_ID/"
# else
# BODY=""
# fi
BODY="WARNING: This is a snapshot of the current development stand. "
BODY+="It may have different issues, and possibly does not work at all. "
BODY+="If this is not what you want, use the latest official release instead."
BODY="WARNING: This is a snapshot of the current development stand. "
BODY+="It may have different issues, and possibly does not work at all. "
BODY+="If this is not what you want, use the latest official release instead."
# BODY=$(<${DIR}/ci-build-body.md)

release_infos=$(curl -H "Authorization: token ${GITHUB_TOKEN}" \
release_infos=$(curl -H "Authorization: token ${GITHUB_TOKEN}" \
--data '{"tag_name": "'"$RELEASE_NAME"'","target_commitish": "'"$TRAVIS_BRANCH"'","name": "'"Continuous build"'","body": "'"$BODY"'","draft": false,"prerelease": true}' "https://api.github.com/repos/$REPO_SLUG/releases")

echo "$release_infos"
echo "$release_infos"

unset upload_url
upload_url=$(echo "$release_infos" | grep '"upload_url":' | head -n 1 | cut -d '"' -f 4 | cut -d '{' -f 1)
echo "upload_url: $upload_url"
unset upload_url
upload_url=$(echo "$release_infos" | grep '"upload_url":' | head -n 1 | cut -d '"' -f 4 | cut -d '{' -f 1)
echo "upload_url: $upload_url"

unset release_url
release_url=$(echo "$release_infos" | grep '"url":' | head -n 1 | cut -d '"' -f 4 | cut -d '{' -f 1)
echo "release_url: $release_url"
unset release_url
release_url=$(echo "$release_infos" | grep '"url":' | head -n 1 | cut -d '"' -f 4 | cut -d '{' -f 1)
echo "release_url: $release_url"

fi # if [ "$TRAVIS_COMMIT" != "$tag_sha" ]
##fi # if [ "$TRAVIS_COMMIT" != "$tag_sha" ]

echo "Upload binaries to the release..."

Expand Down

0 comments on commit 5874c2b

Please sign in to comment.