xwords/xwords4/android/scripts/ci-build.sh
Eric House 0a3851fba2 quick script to build and upload from HEAD
Working around TravisCI having killed my builds
2022-05-15 12:10:03 -07:00

43 lines
846 B
Bash
Executable file

#!/bin/bash
set -e -u
TMPDIR=/tmp/ci-build-$$
usage() {
[ -n "$1" ] && echo "ERROR: $1"
echo "**************************************"
echo "*** Nobody but me will use this!!! ***"
echo "**************************************"
echo "usage: $0 <no args>"
echo "does a clean build of committed HEAD and uploads to eehouse.org"
echo "same as TravisCI does when working"
exit 1
}
[ -z "${1+x}" ] || usage "takes no args"
[ -z "${XW4D_UPLOAD+x}" ] && usage "XW4D_UPLOAD not defined"
REPO=''
while :; do
if [ -f .travis.yml ]; then
REPO=$(pwd)
break
fi
cd ../
done
mkdir -p $TMPDIR
cd $TMPDIR
git clone $REPO
for BUILD in $(find . -name build.gradle); do
DIR=$(basename $(dirname $BUILD))
if [ "$DIR" == "android" ]; then
cd $(dirname $BUILD)
break
fi
done
pwd
./gradlew asXw4dDeb
scp $(find . -name '*.apk') ${XW4D_UPLOAD}