This repository was archived by the owner on Mar 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # ###############################
4+ # Variables
5+ # ###############################
6+
7+ readonly CHANGELOG=" changelog.txt"
8+ readonly DATE=$( date +" %Y-%m-%d" )
9+ readonly REPO=" cloudbox/cloudbox"
10+ readonly TAG=$( git describe --abbrev=0 --tags \
11+ | awk -F. -v OFS=. ' NF==1{print ++$NF}; NF>1{$NF=sprintf("%0*d", length($NF), ($NF+1)); print}' )
12+
13+ # ###############################
14+ # Main
15+ # ###############################
16+
17+ set -e
18+ [ -z " $DEBUG " ] || set -x;
19+
20+ NAME=" ${TAG} "
21+
22+ BODY=$( bash scripts/changelog.sh -s)
23+
24+ payload=$(
25+ jq --null-input \
26+ --arg tag " $TAG " \
27+ --arg name " $TAG " \
28+ --arg body " $BODY " \
29+ ' { tag_name: $tag, name: $name, body: $body, draft: true }'
30+ )
31+
32+ response=$(
33+ curl --fail \
34+ --netrc \
35+ --silent \
36+ --location \
37+ --data " $payload " \
38+ " https://api.github.com/repos/${REPO} /releases"
39+ )
40+
41+ upload_url=" $( echo " $response " | jq -r .upload_url | sed -e " s/{?name,label}//" ) "
42+
43+
44+ # Modifications by desimaniac @ github.com
45+ #
46+ # Source:
47+ # https://gist.github.com/foca/38d82e93e32610f5241709f8d5720156
48+ # Copyright (c) 2016 Nicolas Sanguinetti <hi@nicolassanguinetti.info>
You can’t perform that action at this time.
0 commit comments