mirror of
https://github.com/ArtemSBulgakov/buildozer-action.git
synced 2024-08-16 10:09:52 +02:00
Add feature to change command and workdir
This commit is contained in:
parent
8fbb03b53f
commit
0599011456
3 changed files with 40 additions and 2 deletions
19
README.md
19
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
|
||||
|
|
10
action.yml
10
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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue