Skip to content

Commit

Permalink
Add apk release upload
Browse files Browse the repository at this point in the history
  • Loading branch information
francisduvivier committed Oct 1, 2020
1 parent da52685 commit 2ff9652
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ jobs:
with:
name: app-debug.apk
path: android/app/build/outputs/apk/debug/app-debug.apk

39 changes: 39 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.assemble_debug_apk.outputs.debug_apk_path }}
asset_name: app-debug.apk
asset_content_type: application/vnd.android.package-archive

0 comments on commit 2ff9652

Please sign in to comment.