-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upload android debug apk on Release (#74)
* Use working-dir instead of cd in android build job * Add apk release upload * Upload Android README.md with info about the release apk * Rename apk upload asset to OpenBot-[tag-version].apk * Use concat of secrets.GITHUB_TOKEN and secrets.GH_TOKEN in release Action
- Loading branch information
1 parent
c1496c3
commit b899405
Showing
3 changed files
with
51 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters