forked from proot-me/proot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload
executable file
·42 lines (36 loc) · 993 Bytes
/
upload
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
37
38
39
40
41
42
#!/usr/bin/env bash
set -e
# don't loop if files don't exist
shopt -s nullglob
# exit if TRAVIS_TAG is empty, no need to release anything
if [ -z "${TRAVIS_TAG}" ]; then
exit 0
fi
export "PATH=$(pwd)/tools/bin:$PATH"
# get user and repo names
USERNAME=$(echo ${TRAVIS_REPO_SLUG} | cut -d"/" -f1)
REPONAME=$(echo ${TRAVIS_REPO_SLUG} | cut -d"/" -f2)
# release
github-release release \
--user "${USERNAME}" \
--repo "${REPONAME}" \
--tag "${TRAVIS_TAG}" \
--name "${TRAVIS_TAG}" \
--description "$(cat $(pwd)/dist/release.md)" || true
# binaries
for i in "$(pwd)/dist/"*.tar.xz; do
name=$(basename ${i})
gpg -u 0x3B2FD161 --output "${i}.sig" --detach-sig "${i}"
github-release upload \
--user "${USERNAME}" \
--repo "${REPONAME}" \
--tag "${TRAVIS_TAG}" \
--name "${name}" \
--file "${i}"
github-release upload \
--user "${USERNAME}" \
--repo "${REPONAME}" \
--tag "${TRAVIS_TAG}" \
--name "${name}.sig" \
--file "${i}.sig"
done