From 8c06cbb40f2bda742d7534ed7e572e66a37d8742 Mon Sep 17 00:00:00 2001 From: Damian Krolik Date: Mon, 26 Jul 2021 12:05:16 +0200 Subject: [PATCH] [nrf noup] add workflow for building Android release packages Add a manually triggered workflow for building Android CHIPTool release packages for all the supported platforms: arm, arm64 and x64. --- .github/workflows/release_android.yaml | 89 ++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/workflows/release_android.yaml diff --git a/.github/workflows/release_android.yaml b/.github/workflows/release_android.yaml new file mode 100644 index 00000000000000..5df396ea0be0a7 --- /dev/null +++ b/.github/workflows/release_android.yaml @@ -0,0 +1,89 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Release Android packages + +on: + workflow_dispatch: + inputs: + releaseTag: + description: Release Tag + required: true + +jobs: + android: + name: Build Android + timeout-minutes: 60 + + runs-on: ubuntu-latest + + env: + JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64/ + + container: + image: connectedhomeip/chip-build-android:latest + volumes: + - "/tmp/log_output:/tmp/test_logs" + - "/tmp/output_binaries:/tmp/output_binaries" + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: "${{ github.event.inputs.releaseTag }}" + submodules: true + - name: Bootstrap + timeout-minutes: 10 + run: scripts/build/gn_bootstrap.sh + - name: Build arm CHIPTool + timeout-minutes: 10 + env: + BUILD_TYPE: android_arm + TARGET_CPU: arm + run: | + ./scripts/examples/android_app.sh + yes | "$ANDROID_HOME"/tools/bin/sdkmanager --licenses + cd src/android/CHIPTool + ./gradlew build + cp app/build/outputs/apk/release/app-release-unsigned.apk /tmp/output_binaries/chiptool-arm.apk + - name: Build arm64 CHIPTool + timeout-minutes: 10 + env: + BUILD_TYPE: android_arm64 + TARGET_CPU: arm64 + run: | + ./scripts/examples/android_app.sh + yes | "$ANDROID_HOME"/tools/bin/sdkmanager --licenses + cd src/android/CHIPTool + ./gradlew build + cp app/build/outputs/apk/release/app-release-unsigned.apk /tmp/output_binaries/chiptool-arm64.apk + - name: Build x64 CHIPTool + timeout-minutes: 10 + env: + BUILD_TYPE: android_x64 + TARGET_CPU: x64 + run: | + ./scripts/examples/android_app.sh + yes | "$ANDROID_HOME"/tools/bin/sdkmanager --licenses + cd src/android/CHIPTool + ./gradlew build + cp app/build/outputs/apk/release/app-release-unsigned.apk /tmp/output_binaries/chiptool-x64.apk + - name: Publish packages + uses: softprops/action-gh-release@v1 + with: + files: /tmp/output_binaries/chiptool-*.apk + fail_on_unmatched_files: true + tag_name: "${{ github.event.inputs.releaseTag }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}