mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-09-20 06:01:57 +00:00
build: auto-create github release when docker-versions-create with tag (#1188)
This commit is contained in:
parent
bee39343a6
commit
ffcb76f73f
1 changed files with 25 additions and 0 deletions
|
@ -130,3 +130,28 @@ EOL
|
|||
fi
|
||||
|
||||
done
|
||||
|
||||
if [[ $tag ]]; then
|
||||
if [ -f "$HOME/.github.env" ]; then
|
||||
source "$HOME/.github.env"
|
||||
if [[ $GITHUB_TOKEN ]]
|
||||
then
|
||||
auth=(-u ":$GITHUB_TOKEN")
|
||||
base=https://api.github.com
|
||||
: "${owner:=itzg}"
|
||||
: "${repo:=docker-minecraft-server}"
|
||||
read -r -d '' releaseBody << EOF
|
||||
{
|
||||
"tag_name": "$tag",
|
||||
"name": "$tag",
|
||||
"generate_release_notes": true
|
||||
}
|
||||
EOF
|
||||
if ! curl "${auth[@]}" -H "Accept: application/vnd.github.v3+json" \
|
||||
"${base}/repos/${owner}/${repo}/releases" -d "$releaseBody"; then
|
||||
echo "ERROR failed to create github release $tag"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
Loading…
Reference in a new issue