Can I save the output .apk?
usernein opened this issue · comments
Is it possible to save the built apk? I want to use it as action artifact in my github action.
Of course! You can use fnkr/github-action-ghr for that.
Here is an example:
- name: Publish GitHub Release
uses: fnkr/github-action-ghr@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GHR_PATH: app/app-debug.apk
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
This will publish the .apk
on tagged GitHub releases.
Thank you for the link, it's really useful, but cordova runs in a Docker, right? So the platforms/ folder cannot be easily accessed by other steps like 'actions/upload-artifact' and that's what i was asking for: a way to get the built .apk
I did it by executing the commands in Dockerfile, without using setup-cordova:
https://github.com/deadlyjack/code-editor/blob/8084bf769aca918c1f330b20fe725fcf9069100a/.github/workflows/main.yml
You will need to copy it into the top-level directory from the platforms/android/app/build/outputs
directory, as part of your cordova_exec
command.
with:
cordova_exec: |
cordova build --no-telemetry && \
cp "$(find . -name '*.apk')" .
You can also try using ls -la
in your pipeline to see what files are created in your project directory.
Example: https://github.com/oxr463/pentesting-guide/blob/master/.github/workflows/main.yml#L16