forked from just-containers/socklog-overlay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload
executable file
·39 lines (34 loc) · 894 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
#!/usr/bin/env bash
set -x
# 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
# 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}"
# binaries
for i in dist/*.tar.gz; 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