Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload android debug apk on Release #74

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ jobs:
build:
name: Gradle Checks
runs-on: ubuntu-latest

defaults:
run:
working-directory: android
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
Expand All @@ -33,19 +35,14 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Style
run: |
cd android
./gradlew checkStyle
run: ./gradlew checkStyle
- name: Lint
run: |
cd android
./gradlew lint
run: ./gradlew lint
- name: Build
run: |
cd android
./gradlew build
run: ./gradlew build
- name: Upload
uses: actions/upload-artifact@v2
with:
name: app-debug.apk
path: android/app/build/outputs/apk/debug/app-debug.apk

42 changes: 42 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
release:
types:
- published # We are using published instead of created because otherwise, it would never trigger if it was first created as a draft and then published.

name: Upload Android Apk to Release

jobs:
upload-apk-to-release:
name: Add Android Debug Apk to Release Assets
runs-on: ubuntu-latest
defaults:
run:
working-directory: android
steps:
- uses: actions/checkout@v2
- name: Print Release Url
run: echo "${{ github.event.release.html_url }}"
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Assemble Debug Apk
id: assemble_debug_apk
run: |
./gradlew assembleDebug
echo "::set-output name=debug_apk_path::$(pwd)/app/build/outputs/apk/debug/app-debug.apk"
- name: Specify Release Asset Name using tag [${{github.event.release.tag_name}}]
id: make_asset_name
run: echo "::set-output name=asset_name::OpenBot-$(echo ${{github.event.release.tag_name}}| sed 's/[^-a-zA-Z0-9.]/_/g'| sed 's/^v//').apk"
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.assemble_debug_apk.outputs.debug_apk_path }}
asset_name: ${{steps.make_asset_name.outputs.asset_name}}
asset_content_type: application/vnd.android.package-archive
4 changes: 2 additions & 2 deletions android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Our application is derived from the [TensorFlow Lite Object Detection Android De

### Prerequisites

- Setup [Android Studio](https://developer.android.com/studio/index.html)
- [Android Studio 3.2 or later](https://developer.android.com/studio/index.html) for building and installing the apk, or otherwise download the apk from the assets of the [latest release](https://github.com/intel-isl/OpenBot/releases/latest).
- Android device and Android development environment with minimum API 21
- Android Studio 3.2 or later

### Building

- In case you are using the apk from the assets of the [latest release](https://github.com/intel-isl/OpenBot/releases/latest), you can skip the below steps and instead just [install](https://www.lifewire.com/install-apk-on-android-4177185) it on your phone directly. Note that that apk is signed with a debug key.
- Open Android Studio and select *Open an existing Android Studio project*.
- Select the OpenBot/android directory and click OK.
- Confirm Gradle Sync if neccessary.
Expand Down