-
Notifications
You must be signed in to change notification settings - Fork 22
91 lines (79 loc) · 2.21 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Build
on:
push:
branches: [ "*" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Cache SDK and Toolchain
uses: actions/cache@v4
with:
path: |
build/app
build/innoextract.exe
build/tc32
build/tl_zigbee_sdk
key: |
toolchain-${{ matrix.os }}-${{ hashFiles('build/tc32') }}
restore-keys: |
toolchain-${{ matrix.os }}
save-always: true
- name: Install SDK and Toolchain (Windows)
if: matrix.os == 'windows-latest'
run: |
mkdir build -ErrorAction SilentlyContinue
cd build
cmake -P ../cmake/TelinkSDK_Win.cmake
choco install ninja
- name: Install SDK and Toolchain (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
mkdir -p build
cd build
cmake -P ../cmake/TelinkSDK_Linux.cmake
- name: Add Toolchain Path (Windows)
if: matrix.os == 'windows-latest'
run: |
"${PWD}\build\app\opt\tc32\bin;${PWD}\build\app\bin\" | Out-File -File $env:GITHUB_PATH -Append
- name: Build (Windows)
if: matrix.os == 'windows-latest'
run: |
cmake . -G "Ninja" -B build
cmake --build build
- name: Build (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
cmake . -B build
cmake --build build
- name: Archive switch files
uses: actions/upload-artifact@v4
with:
name: switch-${{matrix.os}}
path: |
build/switch/switch*
build/switch/*switch.zigbee
!build/**/*.lst
- name: Archive light files
uses: actions/upload-artifact@v4
with:
name: light-${{matrix.os}}
path: |
build/light/light*
build/light/*light.zigbee
!build/**/*.lst
- name: Archive IASsensor files
uses: actions/upload-artifact@v4
with:
name: IASsensor-${{matrix.os}}
path: |
build/IASsensor/IASsensor*
build/IASsensor/*IASsensor.zigbee
!build/**/*.lst