Skip to content

Commit

Permalink
Release 2.3.52
Browse files Browse the repository at this point in the history
  • Loading branch information
Builder committed Jan 24, 2024
1 parent 2b0eddb commit 998552c
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 13 deletions.
16 changes: 16 additions & 0 deletions RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
v2.3.49
2.3.52
2.3.52
2.3.52
2.3.52
2.3.52
2.3.52
2.3.52
2.3.52
2.3.52
2.3.52
2.3.52
2.3.52
2.3.52
2.3.52
2.3.52
2.3.52
1 change: 1 addition & 0 deletions releases/v2.3.52/installer-linux-x64.bin.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
699d7693db53ddb83514491646985600
1 change: 1 addition & 0 deletions releases/v2.3.52/installer-linux-x86.bin.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d5d9daaaf4965c21fad4eb74b5af345c
1 change: 1 addition & 0 deletions releases/v2.3.52/installer-windows-x64.exe.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
edd25b3023ecd0944016d79db860db23
1 change: 1 addition & 0 deletions releases/v2.3.52/installer-windows-x86.exe.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dfd8c5649730ee661c0a9dd7cee4ab21
1 change: 1 addition & 0 deletions releases/v2.3.52/upgrader.zip.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
343a538e42cf65670a6fad909cfa48f7
29 changes: 16 additions & 13 deletions scripts/git-release-assets.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash

# if we shall try to delete an asset before uploading
delete=0
Expand All @@ -15,8 +15,8 @@ do
case $opt in
(c) create=1 ;;
(d) delete=1 ;;
(m) message=${OPTARG};;
(t) token=${OPTARG};;
(m) message="${OPTARG}";;
(t) token="${OPTARG}";;
(h|?)
echo "Usage: git-release-assets.sh [-d] [-h|?] <owner> <repo> [<tag> [<file>]]"
echo " -c Create a release if it is not existing"
Expand Down Expand Up @@ -64,10 +64,10 @@ fi
# best effort, if already exists, ignore
create_tag() {
tag=$1
message=$2
msg="$2"

echo "Creating tag $tag ..."
git tag -a $tag -m "$message"
git tag -a $tag -m "$msg"
git push --tags
echo "Tag $tag created."
}
Expand All @@ -94,8 +94,11 @@ get_release() {
"https://api.github.com/repos/$OWNER/$REPO/releases/tags/$tag"
)

http_code=$(tail -n1 <<< "$response") # get the last line
content=$(sed '$ d' <<< "$response") # get all but the last line which contains the status code
# get the last line
http_code=$(tail -n1 <<< "$response")

# get all but the last line which contains the status code
content=$(sed '$ d' <<< "$response")

if [ $http_code = 200 ]; then
jq '.id' <<< "$content"
Expand All @@ -109,16 +112,16 @@ get_release() {
# best effort, if already exists, ignore
create_release() {
tag=$1
message=$2
msg="$2"

# first create the tag
echo "Try create tag $tag ..."
create_tag $tag $message;
create_tag $tag "$msg";

# now create the release
echo "Try create release with tag $tag ..."

data=$(printf '{"tag_name": "%s","target_commitish": "main","name": "%s","body": "%s","draft": false,"prerelease": false,"generate_release_notes":false}' $tag $tag "$message")
data=$(printf '{"tag_name": "%s","target_commitish": "main","name": "%s","body": "%s","draft": false,"prerelease": false,"generate_release_notes":false}' $tag $tag "$msg")

response=$(
curl -sL -w '%{http_code}'\
Expand All @@ -133,7 +136,7 @@ create_release() {
http_code=$(tail -n1 <<< "$response") # get the last line
content=$(sed '$ d' <<< "$response") # get all but the last line which contains the status code

if [ $http_code = 200 ]; then
if [ $http_code = 201 ]; then
echo "Release with tag $tag successfully created"
elif [ $http_code = 422 ]; then
echo "Release with tag $tag already exists"
Expand Down Expand Up @@ -263,7 +266,7 @@ list_assets() {

if [ $http_code = 200 ]; then
echo "Assets in release with tag $RELEASE_TAG:"
jq '.[] | .name + " => " + (.size|tostring)' <<< "$content"
jq '.[] | .name + " => " + (.size|tostring) + ": " + .url' <<< "$content"
else
printf "ERROR: Something went wrong (status code: $http_code), aborting!\n" >&2
exit 1
Expand All @@ -276,7 +279,7 @@ if [ -z "$RELEASE_TAG" ]; then
elif [ -z "$FILE" ]; then
if [ $create -eq 1 ]; then
echo "Try create release with tag $RELEASE_TAG ..."
create_release $RELEASE_TAG $message
create_release $RELEASE_TAG "$message"
elif [ $delete -eq 1 ]; then
echo "Try delete release with tag $RELEASE_TAG ..."
remove_release $RELEASE_TAG
Expand Down

0 comments on commit 998552c

Please sign in to comment.