forked from jprellberg/apt-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish-jar.sh
executable file
·45 lines (32 loc) · 1.33 KB
/
publish-jar.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
# NOTE: stdout/stderr might/should be discarded to not leak sensitive information.
echo "Post-processing JAR."
# GH_TOKEN won't be available for PRs from forks.
# (http://docs.travis-ci.com/user/pull-requests/#Security-Restrictions-when-testing-Pull-Requests).
if [ -z "GH_TOKEN" ]; then
echo "No GH_TOKEN available. Skipping."
exit
fi
# NOTE: DO NOT USE "set -x", or anything else that would reveal GH_TOKEN!
set -e
set +x
REPO_APIDOC="https://${GH_TOKEN}@github.com/CvO-Theory/apt-gui-builds"
REPO_DIR="$PWD"
# Export these to not add "git config" calls to the long command.
export GIT_AUTHOR_NAME="ParSysRobot on Travis CI"
export GIT_AUTHOR_EMAIL="ParSysRobot@users.noreply.github.com"
export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"
export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"
git clone --depth 1 --quiet --branch gh-pages $REPO_APIDOC /tmp/gh-pages
cd /tmp/gh-pages
cp "${REPO_DIR}/build/libs/apt-gui.jar" .
cp "${REPO_DIR}/build/libs/apt-gui-thin.jar" .
git add --all .
# Commit the relevant changes.
COMMIT_MSG="Update build via Travis
Last commit message:
$(cd $REPO_DIR && git log -1 --pretty=format:%s)
Build URL: https://travis-ci.org/CvO-Theory/apt-gui/builds/${TRAVIS_BUILD_ID}"
git commit -m "$COMMIT_MSG"
git push --quiet origin gh-pages
# vim: filetype=sh:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80