forked from rednblkx/esp-homekit-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
97 lines (85 loc) · 2.73 KB
/
.gitlab-ci.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
92
93
94
95
96
97
stages:
- build
variables:
GIT_SUBMODULE_STRATEGY: recursive
.build_template:
stage: build
image: espressif/idf:latest
tags:
- build
variables:
EXAMPLES: "aws-iot bridge data_tlv8 emulator fan lightbulb smart_outlet"
EXAMPLE_TARGETS: "esp32 esp32c3 esp32s3"
artifacts:
paths:
- examples/fan/build/*.bin
- examples/fan/build/*.elf
- examples/fan/build/*.map
- examples/fan/build/bootloader/*.bin
artifacts:
paths:
- $CI_PROJECT_DIR/esp-homekit-sdk-bins-${CI_JOB_ID}.zip
expire_in: 3 mos
before_script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo -n $GITLAB_KEY >> ~/.ssh/id_rsa_base64
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
script:
- for EXAMPLE in $EXAMPLES; do
- cd $CI_PROJECT_DIR/examples/$EXAMPLE
- echo Building $EXAMPLE
- if [[ "$EXAMPLE" == "aws-iot" ]]; then
- mkdir components
- cd components
- echo Cloning esp-aws-iot
- git clone --depth 1 -b release/v3.1.x --single-branch --recursive https://github.com/espressif/esp-aws-iot.git
- export AWS_IOT_PATH=$PWD/esp-aws-iot
- cd ..
- touch main/certs/device.crt main/certs/device.key
- fi
- for TARGET in $EXAMPLE_TARGETS; do
- echo Building for $TARGET
- idf.py set-target $TARGET
- idf.py build
- mkdir -p $CI_PROJECT_DIR/esp-homekit-sdk-bins-${CI_JOB_ID}/$EXAMPLE/$TARGET/
- cp $CI_PROJECT_DIR/examples/$EXAMPLE/build/*.bin $CI_PROJECT_DIR/esp-homekit-sdk-bins-${CI_JOB_ID}/$EXAMPLE/$TARGET/
- done
- echo Build Complete for $EXAMPLE
- done
# Generating zip file for binaries generated
- cd $CI_PROJECT_DIR
- echo Generating zip file for binaries generated
- tar -zcvf esp-homekit-sdk-bins-${CI_JOB_ID}.zip esp-homekit-sdk-bins-${CI_JOB_ID}/
build_idf_v4.1:
extends: .build_template
image: espressif/idf:release-v4.1
variables:
EXAMPLE_TARGETS: "esp32"
build_idf_v4.2:
extends: .build_template
image: espressif/idf:release-v4.2
variables:
EXAMPLE_TARGETS: "esp32 esp32s2"
build_idf_v4.3:
extends: .build_template
image: espressif/idf:release-v4.3
variables:
EXAMPLE_TARGETS: "esp32 esp32s2 esp32c3"
build_idf_v4.4:
extends: .build_template
image: espressif/idf:release-v4.4
variables:
EXAMPLE_TARGETS: "esp32 esp32s2 esp32c3 esp32s3"
build_idf_v5.0:
extends: .build_template
image: espressif/idf:release-v5.0
variables:
EXAMPLE_TARGETS: "esp32 esp32s2 esp32c3 esp32s3"
build_idf_v5.1:
extends: .build_template
image: espressif/idf:release-v5.1
variables:
EXAMPLE_TARGETS: "esp32 esp32s2 esp32c3 esp32s3 esp32c2 esp32c6"