Skip to content

Commit e59ee7b

Browse files
committed
upload-to-github: support uploading to different repositories
The idea of `upload-to-github.sh` was to attach files such as the installer to a given tag. The net installer should be attached to a tag of the build-extra repository, of course, but the obvious best repository to attach Git for Windows installers is https://github.com/git-for-windows/git. So let's add a `--repo=<repo>` option so that we can easily upload all generated installers and portable applications via /usr/src/build-extra/upload-to-github.sh --repo=git \ v2.3.5.windows.4 ~/*2.3.5.4*.exe Signed-off-by: Johannes Schindelin <[email protected]>
1 parent e3cb2f2 commit e59ee7b

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

upload-to-github.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@ die () {
66
}
77

88
test $# -ge 2 ||
9-
die "Usage: $0 <tag-name> <path>..."
9+
die "Usage: $0 [--repo=<repo>] <tag-name> <path>..."
10+
11+
repo=build-extra
12+
case "$1" in
13+
--repo=*)
14+
repo=${1#--repo=}
15+
shift
16+
;;
17+
esac
1018

1119
tagname="$1"
1220
shift
1321

14-
url=https://api.github.com/repos/git-for-windows/build-extra/releases
22+
url=https://api.github.com/repos/git-for-windows/$repo/releases
1523
id="$(curl --netrc -s $url |
1624
grep -B1 "\"tag_name\": \"$tagname\"" |
1725
sed -n 's/.*"id": *\([0-9]*\).*/\1/p')"

0 commit comments

Comments
 (0)