mirror of
https://github.com/kami-blue/client
synced 2025-01-10 00:39:24 +00:00
[fix] Added more safety to uploadRelease.sh
Signed-off-by: Dominika <sokolov.dominika@gmail.com>
This commit is contained in:
parent
59da9324dc
commit
30a138030a
@ -15,13 +15,21 @@ check_var "3" "$3" || exit $?
|
||||
check_var "KAMI_REPO_MAJOR" "$KAMI_REPO_MAJOR" || exit $?
|
||||
check_var "KAMI_REPO_NIGHTLY" "$KAMI_REPO_NIGHTLY" || exit $?
|
||||
check_var "GITHUB_TOKEN" "$GITHUB_TOKEN" || exit $?
|
||||
check_var "KAMI_DIR" "$KAMI_DIR" || exit $?
|
||||
check_git || exit $?
|
||||
|
||||
cd "$KAMI_DIR" || exit $?
|
||||
BRANCH="$(git symbolic-ref -q HEAD | sed "s/^refs\/heads\///g")"
|
||||
REPO="$KAMI_REPO_NIGHTLY"
|
||||
|
||||
check_var "git symbolic-ref -q HEAD" "$BRANCH" || exit $?
|
||||
|
||||
[ "$1" == "major" ] && REPO="$KAMI_REPO_MAJOR"
|
||||
|
||||
# Create release
|
||||
curl -s -H "Authorization: token $GITHUB_TOKEN" -X POST --data "$(generate_release_data "$KAMI_OWNER" "$REPO" "$3" "$2" "$3" "$5" "false" "false")" "https://api.github.com/repos/$KAMI_OWNER/$REPO/releases" || exit $?
|
||||
# shellcheck disable=SC2001
|
||||
CHANGELOG="$(echo "$5" | sed "s/[\"';]//g")"
|
||||
curl -s -H "Authorization: token $GITHUB_TOKEN" -X POST --data "$(generate_release_data "$KAMI_OWNER" "$REPO" "$3" "$BRANCH" "$3" "$CHANGELOG" "false" "false")" "https://api.github.com/repos/$KAMI_OWNER/$REPO/releases" || exit $?
|
||||
|
||||
# Upload jar to release
|
||||
"$__scripts/uploadReleaseAsset.sh" github_api_token="$GITHUB_TOKEN" owner="$KAMI_OWNER" repo="$REPO" tag="$3" filename="$KAMI_DIR/build/libs/$4"
|
||||
|
Loading…
Reference in New Issue
Block a user