Skip to content

Commit 8c06cbb

Browse files
committed
[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.
1 parent 762a204 commit 8c06cbb

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed
+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Copyright (c) 2021 Project CHIP Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: Release Android packages
16+
17+
on:
18+
workflow_dispatch:
19+
inputs:
20+
releaseTag:
21+
description: Release Tag
22+
required: true
23+
24+
jobs:
25+
android:
26+
name: Build Android
27+
timeout-minutes: 60
28+
29+
runs-on: ubuntu-latest
30+
31+
env:
32+
JAVA_HOME: /usr/lib/jvm/java-8-openjdk-amd64/
33+
34+
container:
35+
image: connectedhomeip/chip-build-android:latest
36+
volumes:
37+
- "/tmp/log_output:/tmp/test_logs"
38+
- "/tmp/output_binaries:/tmp/output_binaries"
39+
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v2
43+
with:
44+
ref: "${{ github.event.inputs.releaseTag }}"
45+
submodules: true
46+
- name: Bootstrap
47+
timeout-minutes: 10
48+
run: scripts/build/gn_bootstrap.sh
49+
- name: Build arm CHIPTool
50+
timeout-minutes: 10
51+
env:
52+
BUILD_TYPE: android_arm
53+
TARGET_CPU: arm
54+
run: |
55+
./scripts/examples/android_app.sh
56+
yes | "$ANDROID_HOME"/tools/bin/sdkmanager --licenses
57+
cd src/android/CHIPTool
58+
./gradlew build
59+
cp app/build/outputs/apk/release/app-release-unsigned.apk /tmp/output_binaries/chiptool-arm.apk
60+
- name: Build arm64 CHIPTool
61+
timeout-minutes: 10
62+
env:
63+
BUILD_TYPE: android_arm64
64+
TARGET_CPU: arm64
65+
run: |
66+
./scripts/examples/android_app.sh
67+
yes | "$ANDROID_HOME"/tools/bin/sdkmanager --licenses
68+
cd src/android/CHIPTool
69+
./gradlew build
70+
cp app/build/outputs/apk/release/app-release-unsigned.apk /tmp/output_binaries/chiptool-arm64.apk
71+
- name: Build x64 CHIPTool
72+
timeout-minutes: 10
73+
env:
74+
BUILD_TYPE: android_x64
75+
TARGET_CPU: x64
76+
run: |
77+
./scripts/examples/android_app.sh
78+
yes | "$ANDROID_HOME"/tools/bin/sdkmanager --licenses
79+
cd src/android/CHIPTool
80+
./gradlew build
81+
cp app/build/outputs/apk/release/app-release-unsigned.apk /tmp/output_binaries/chiptool-x64.apk
82+
- name: Publish packages
83+
uses: softprops/action-gh-release@v1
84+
with:
85+
files: /tmp/output_binaries/chiptool-*.apk
86+
fail_on_unmatched_files: true
87+
tag_name: "${{ github.event.inputs.releaseTag }}"
88+
env:
89+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)