-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgithub-release.sh
More file actions
executable file
·38 lines (32 loc) · 1009 Bytes
/
github-release.sh
File metadata and controls
executable file
·38 lines (32 loc) · 1009 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#! /bin/bash
source $(dirname "$0")/version.sh
# Set default version to develop
BUILD_VERSION=develop
# Trigger read version
read_version
echo "Build version: $BUILD_VERSION"
create_release() {
user="aperture-data"
repo="aperturedb-python"
token=$TOKEN
tag="v$BUILD_VERSION"
command="curl -s -o release.json -w '%{http_code}' \
--request POST \
--header 'Accept: application/vnd.github+json' \
--header 'Authorization: Bearer ${token}' \
--header 'X-GitHub-Api-Version: 2022-11-28' \
--data '{\"tag_name\": \"${tag}\", \"name\": \"${tag}\", \"body\":\"Release ${tag}\"}' \
https://api.github.com/repos/$user/$repo/releases"
http_code=`eval $command`
if [ $http_code == "201" ]; then
echo "created release:"
cat release.json
else
echo "create release failed with code '$http_code':"
cat release.json
echo "command:"
echo $command
return 1
fi
}
create_release