2020-06-23 13:57:51 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-06-23 14:01:06 +02:00
|
|
|
# GitHub sets root as owner of repository directory. Change it to user
|
|
|
|
sudo chown -R "$USER" "$GITHUB_WORKSPACE"
|
|
|
|
# GitHub sets HOME to /github/home, but Buildozer is installed to /home/user. Change HOME to user's home
|
|
|
|
export HOME=$HOME_DIR
|
|
|
|
|
2020-06-23 14:02:49 +02:00
|
|
|
# Buildozer settings to disable interactions
|
|
|
|
export BUILDOZER_WARN_ON_ROOT=0
|
|
|
|
export APP_ANDROID_ACCEPT_SDK_LICENSE=1
|
|
|
|
# Do not allow to change directories
|
|
|
|
export BUILDOZER_BUILD_DIR=./.buildozer
|
|
|
|
export BUILDOZER_BIN=./bin
|
|
|
|
|
2020-06-23 14:05:39 +02:00
|
|
|
# Change directory to workir
|
|
|
|
if ! cd "$INPUT_WORKDIR"; then
|
|
|
|
echo ::error::Specified workdir is not exists.
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Run command
|
|
|
|
if ! sh -c "$INPUT_COMMAND"; then
|
|
|
|
echo ::error::Error while executing command \""$INPUT_COMMAND"\"
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-06-23 14:01:06 +02:00
|
|
|
|
|
|
|
# Give access to root
|
|
|
|
sudo chown -R root "$GITHUB_WORKSPACE"
|
2020-06-23 14:07:13 +02:00
|
|
|
|
|
|
|
# Set output
|
|
|
|
if [ ! -d bin ]; then
|
|
|
|
echo ::error::Output directory does not exist. See Buildozer log for error
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
filename=$(ls bin | head -n1)
|
|
|
|
echo ::set-output name=filename::"$INPUT_WORKDIR/bin/$filename"
|