blob: d9ccc0aadb065b98afc2da2735730d2b194d3a46 (
plain)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
#!/bin/bash
set -e
if [[ "x${TRAVIS_PULL_REQUEST}" != "xfalse" ]]; then
echo "This is a pull request. skipping deploy ..."
exit 0
fi
if [[ "x${TRAVIS_BRANCH}" != "xmaster" ]] && [[ "x${TRAVIS_TAG}" != xv* ]]; then
echo "This isn't master branch nor a valid tag. skipping deploy ..."
exit 0
fi
if [[ "x${CC}" != "xgcc" ]] || [[ "x${TARGET}" = "xvalgrind" ]] || [[ "x${TARGET}" = "xmake-embedded" ]]; then
echo "Invalid target for deploy. skipping ..."
exit 0
fi
if [[ ! -d build ]]; then
echo "Build directory not found."
exit 1
fi
FILES=
if [[ -n "${TARGET}" ]] && [[ -e ".travis/targets/${TARGET}.sh" ]]; then
source ".travis/targets/${TARGET}.sh"
else
echo "Target not defined or invalid!"
exit 1
fi
deploy
TARNAME="$(grep PACKAGE_TARNAME build/config.h | cut -d\" -f2)"
VERSION="$(grep PACKAGE_VERSION build/config.h | cut -d\" -f2)"
do_sha512() {
pushd "$(dirname ${1})" > /dev/null
sha512sum "$(basename ${1})"
popd > /dev/null
}
do_curl() {
curl \
--silent \
--form "project=${TARNAME}" \
--form "version=${VERSION}" \
--form "file=@${1}" \
--form "sha512=$(do_sha512 ${1})" \
"${DISTFILES_URL}" \
&> /dev/null # make sure that we don't leak tokens
}
echo " * Found files:"
for f in "${FILES[@]}"; do
echo " $(basename ${f})"
done
echo
for f in "${FILES[@]}"; do
echo " * Processing file: $(basename ${f}):"
echo -n " Uploading file ... "
do_curl "${f}"
echo "done"
echo
done
|