Refactor the CameraService #249
Workflow file for this run
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
name: Build app | |
on: [pull_request, push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code | |
uses: actions/checkout@v2 | |
- name: Setup ndk | |
uses: nttld/setup-ndk@v1 | |
with: | |
ndk-version: r21d | |
- name: Build the app | |
run: | | |
./gradlew assembleRelease | |
working-directory: ./app | |
- name: Setup build tool version variable | |
shell: bash | |
run: | | |
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1) | |
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV | |
echo Last build tool version is: $BUILD_TOOL_VERSION | |
- uses: r0adkll/sign-android-release@v1 | |
name: Sign app APK | |
id: sign_app | |
with: | |
releaseDirectory: app/app/build/outputs/apk/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
env: | |
BUILD_TOOLS_VERSION: ${{ env.BUILD_TOOL_VERSION }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Signed app | |
path: ${{steps.sign_app.outputs.signedReleaseFile}} | |
- name: Get the version | |
if: startsWith(github.ref, 'refs/tags/') | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} | |
- name: Move and name release | |
if: startsWith(github.ref, 'refs/tags/') | |
run: mv ${{steps.sign_app.outputs.signedReleaseFile}} octo4a-${{steps.get_version.outputs.VERSION}}.apk | |
- name: Create github release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: octo4a-${{steps.get_version.outputs.VERSION}}.apk | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |