-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.sh
executable file
·28 lines (22 loc) · 1.03 KB
/
deploy.sh
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
#!/bin/bash
repo=ICIJ/datashare-installer
release=$1
if [[ -z "$release" ]]; then
echo "usage: $0 <release_name>"
exit 1
fi
upload_url=$(curl -s -H "Accept: application/vnd.github.v3+json" "https://api.github.com/repos/$repo/releases/tags/${release}" | jq -r '.upload_url')
upload_url="${upload_url%\{*}"
echo "uploading asset to release to url : $upload_url"
curl -s \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/x-xar" \
--data-binary "@mac/dist/datashare-$release.pkg" "$upload_url?name=datashare-$release.pkg&label=datashare-$release.pkg"
curl -s \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/vnd.microsoft.portable-executable" \
--data-binary "@windows/dist/datashare-$release.exe" "$upload_url?name=datashare-$release.exe&label=datashare-$release.exe"
curl -s \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Content-Type: application/x-sh" \
--data-binary "@linux/dist/datashare-$release.sh" "$upload_url?name=datashare-$release.sh&label=datashare-$release.sh"