diff --git a/README.md b/README.md index 224f72d..c62c542 100644 --- a/README.md +++ b/README.md @@ -21,11 +21,20 @@ but adds some features and patches to use in GitHub Actions. - _Default:_ `.` (top directory). - Set to `src` if buildozer.spec is in `src` directory. +## Outputs + +### `filename` + +Filename of built package relative to repository root. + +- Example: `test_app/bin/testapp-0.1-armeabi-v7a-debug.apk` + ## Example usage ```yaml - name: Build with Buildozer uses: ArtemSBulgakov/buildozer-action@v1 + id: buildozer with: command: buildozer android debug workir: src diff --git a/action.yml b/action.yml index 4fac757..5b5c12b 100644 --- a/action.yml +++ b/action.yml @@ -15,6 +15,10 @@ inputs: required: true default: . +outputs: + filename: + description: Filename of built package + runs: using: docker image: Dockerfile diff --git a/entrypoint.sh b/entrypoint.sh index 9dadf1c..6df7fe2 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -26,3 +26,11 @@ fi # Give access to root sudo chown -R root "$GITHUB_WORKSPACE" + +# 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"