Workflow file for this run
This file contains hidden or 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
| 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 | |
| - name: Specify Release Asset Paths | |
| id: asset_paths | |
| run: | | |
| echo "::set-output name=openbot_apk_path::$(pwd)/robot/build/outputs/apk/debug/robot-debug.apk" | |
| echo "::set-output name=controller_apk_path::$(pwd)/controller/build/outputs/apk/debug/controller-debug.apk" | |
| - name: Specify Release Asset Names using Tag [${{github.event.release.tag_name}}] | |
| id: asset_names | |
| run: | | |
| echo "::set-output name=openbot_name::OpenBot-$(echo ${{github.event.release.tag_name}}| sed 's/[^-a-zA-Z0-9.]/_/g'| sed 's/^v//').apk" | |
| echo "::set-output name=controller_name::Controller-$(echo ${{github.event.release.tag_name}}| sed 's/[^-a-zA-Z0-9.]/_/g'| sed 's/^v//').apk" | |
| - name: Upload OpenBot Asset | |
| id: upload-openbot-asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ${{ steps.asset_paths.outputs.openbot_apk_path }} | |
| asset_name: ${{ steps.asset_names.outputs.openbot_name }} | |
| asset_content_type: application/vnd.android.package-archive | |
| - name: Upload Controller Asset | |
| id: upload-controller-asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| with: | |
| upload_url: ${{ github.event.release.upload_url }} | |
| asset_path: ${{ steps.asset_paths.outputs.controller_apk_path }} | |
| asset_name: ${{ steps.asset_names.outputs.controller_name }} | |
| asset_content_type: application/vnd.android.package-archive |