From c8888204e41a667b473d9c583037c0d87cba9fdf Mon Sep 17 00:00:00 2001 From: Artem Bulgakov Date: Tue, 23 Jun 2020 15:07:13 +0300 Subject: [PATCH] Add filename output --- README.md | 9 +++++++++ action.yml | 4 ++++ entrypoint.sh | 8 ++++++++ 3 files changed, 21 insertions(+) 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"