diff --git a/README.md b/README.md index 9a3b592..224f72d 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,30 @@ with [Buildozer](https://github.com/kivy/buildozer). This action uses official Buildozer [Docker image](https://github.com/kivy/buildozer/blob/master/Dockerfile), but adds some features and patches to use in GitHub Actions. +## Inputs + +### `command` + +**Required** Command to start Buildozer. + +- _Default:_ `buildozer android debug` _(iOS and OSX is not supported because Docker cannot run on MacOS)_. +- For more commands use `;` as delimiter: `python3 setup.py build_ext --inplace; buildozer android debug`. + +### `workdir` + +**Required** Working directory where buildozer.spec is located. + +- _Default:_ `.` (top directory). +- Set to `src` if buildozer.spec is in `src` directory. + ## Example usage ```yaml - name: Build with Buildozer uses: ArtemSBulgakov/buildozer-action@v1 + with: + command: buildozer android debug + workir: src ``` ## License diff --git a/action.yml b/action.yml index 824d01b..4fac757 100644 --- a/action.yml +++ b/action.yml @@ -5,6 +5,16 @@ branding: icon: package color: yellow +inputs: + command: + description: Command to start Buildozer. Set to `buildozer ios debug` for iOS + required: true + default: buildozer android debug + workdir: + description: Working directory where buildozer.spec is located. Set to `src` if buildozer.spec is in `src` directory + required: true + default: . + runs: using: docker image: Dockerfile diff --git a/entrypoint.sh b/entrypoint.sh index 6c0b888..9dadf1c 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,8 +12,17 @@ export APP_ANDROID_ACCEPT_SDK_LICENSE=1 export BUILDOZER_BUILD_DIR=./.buildozer export BUILDOZER_BIN=./bin -# Run build -sh -c "buildozer android debug" +# 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 # Give access to root sudo chown -R root "$GITHUB_WORKSPACE"