-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease-github.sh
More file actions
executable file
·36 lines (29 loc) · 1.03 KB
/
release-github.sh
File metadata and controls
executable file
·36 lines (29 loc) · 1.03 KB
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
#!/usr/bin/env bash
USER=$1
TOKEN=$2
TAG=$3
res=$(curl --user "$USER:$TOKEN" -X POST "https://api.github.com/repos/gerald24/possy/releases" \
-d "
{
\"tag_name\": \"$TAG\",
\"name\": \"Possy $TAG\",
\"body\": \"Release of Possy $TAG\",
\"draft\": false,
\"prerelease\": false
}")
echo "Create release result: $res"
rel_id=$(echo "$res" | python -c 'import json,sys;print(json.load(sys.stdin)["id"])')
daemon_file_name="possy-daemon-${TAG:1}.jar"
daemon_file="daemon/target/daemon-${TAG:1}.jar"
curl \
--user "$USER:$TOKEN" \
-X POST "https://uploads.github.com/repos/gerald24/possy/releases/${rel_id}/assets?name=${daemon_file_name}" \
--header "Content-Type: text/javascript" \
--upload-file "$daemon_file"
service_file_name="possy-service-${TAG:1}.jar"
service_file="service/target/service-${TAG:1}.jar"
curl \
--user "$USER:$TOKEN" \
-X POST "https://uploads.github.com/repos/gerald24/possy/releases/${rel_id}/assets?name=${service_file_name}" \
--header "Content-Type: text/javascript" \
--upload-file "$service_file"