@@ -3,12 +3,72 @@ name: Build esptool
3
3
on : [push, pull_request]
4
4
5
5
jobs :
6
+ build-esptool-binaries-arm :
7
+ name : Build esptool binaries for ${{ matrix.platform }}
8
+ runs-on : ubuntu-latest
9
+ strategy :
10
+ matrix :
11
+ platform : [armv7, aarch64]
12
+ env :
13
+ DISTPATH : esptool-${{ matrix.platform }}
14
+ STUBS_DIR : ./esptool/targets/stub_flasher/
15
+ EFUSE_DIR : ./espefuse/efuse_defs/
16
+ PIP_EXTRA_INDEX_URL : " https://dl.espressif.com/pypi"
17
+ steps :
18
+ - name : Checkout repository
19
+ uses : actions/checkout@master
20
+ - uses : uraimo/run-on-arch-action@v2
21
+ name : Build and test in ${{ matrix.platform }}
22
+ with :
23
+ distro : ubuntu20.04
24
+ shell : /bin/bash
25
+ # Not required, but speeds up builds by storing container images in
26
+ # a GitHub package registry.
27
+ githubToken : ${{ github.token }}
28
+ # Create an artifacts directory
29
+ setup : mkdir -p "${PWD}/${{ env.DISTPATH }}"
30
+ dockerRunArgs : --volume "${PWD}/${{ env.DISTPATH }}:/${{ env.DISTPATH }}"
31
+ install : |
32
+ apt-get update -y
33
+ apt-get install -y python3 python3-pip python3-setuptools libffi-dev
34
+ run : |
35
+ adduser --disabled-password --gecos "" builder
36
+ chmod -R a+rwx /home/runner/work/esptool
37
+ su builder <<EOF
38
+ export PATH=\$PATH:/home/builder/.local/bin
39
+ # Install dependencies
40
+ python -m pip install --upgrade pip
41
+ # PyInstaller >=6.0 results in significantly more antivirus false positives
42
+ pip install pyinstaller==5.13.2
43
+ pip install --user -e .
44
+
45
+ # Build with PyInstaller
46
+ pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico --add-data="${{ env.STUBS_DIR }}1/*.json:${{ env.STUBS_DIR }}1/" --add-data="${{ env.STUBS_DIR }}2/*.json:${{ env.STUBS_DIR }}2/" esptool.py
47
+ pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico --add-data="${{ env.EFUSE_DIR }}*.yaml:${{ env.EFUSE_DIR }}" espefuse.py
48
+ pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico espsecure.py
49
+ pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico esp_rfc2217_server.py
50
+
51
+ # Test binaries
52
+ ./${{ env.DISTPATH }}/esptool -h
53
+ ./${{ env.DISTPATH }}/espefuse -h
54
+ ./${{ env.DISTPATH }}/espsecure -h
55
+ ./${{ env.DISTPATH }}/esp_rfc2217_server -h
56
+
57
+ # Add license and readme
58
+ mv LICENSE README.md ./${{ env.DISTPATH }}
59
+
60
+ - name : Archive artifact
61
+ uses : actions/upload-artifact@master
62
+ with :
63
+ name : ${{ env.DISTPATH }}
64
+ path : ${{ env.DISTPATH }}
65
+
6
66
build-esptool-binaries :
7
67
name : Build esptool binaries for ${{ matrix.platform }}
8
68
runs-on : ${{ matrix.RUN_ON }}
9
69
strategy :
10
70
matrix :
11
- platform : [macos-amd64, macos-arm64, windows, linux-amd64, linux-arm32, linux-arm64 ]
71
+ platform : [macos-amd64, macos-arm64, windows, linux-amd64]
12
72
include :
13
73
- platform : macos-amd64
14
74
TARGET : macos-amd64
27
87
TARGET : linux-amd64
28
88
SEPARATOR : ' :'
29
89
RUN_ON : ubuntu-20.04
30
- - platform : linux-arm32
31
- CONTAINER : python:3.8-bullseye
32
- TARGET : linux-arm32
33
- SEPARATOR : ' :'
34
- RUN_ON : [ARM, self-hosted, linux, docker]
35
- - platform : linux-arm64
36
- CONTAINER : python:3.8-bullseye
37
- TARGET : linux-arm64
38
- SEPARATOR : ' :'
39
- RUN_ON : [ARM64, self-hosted, linux]
40
- container : ${{ matrix.CONTAINER }} # use python container on ARM
41
90
env :
42
91
DISTPATH : esptool-${{ matrix.TARGET }}
43
92
STUBS_DIR : ./esptool/targets/stub_flasher/
47
96
- name : Checkout repository
48
97
uses : actions/checkout@master
49
98
- name : Set up Python 3.8
50
- # Skip setting python on ARM because of missing compatibility: https://github.com/actions/setup-python/issues/108
51
- if : matrix.platform != 'linux-arm32' && matrix.platform != 'linux-arm64'
52
99
uses : actions/setup-python@master
53
100
with :
54
101
python-version : 3.8
94
141
create_release :
95
142
name : Create GitHub release
96
143
if : startsWith(github.ref, 'refs/tags/') && !(contains(github.ref_name, 'dev'))
97
- needs : build-esptool-binaries
144
+ needs : [ build-esptool-binaries, build-esptool-binaries-arm]
98
145
runs-on : ubuntu-latest
99
146
env :
100
147
PIP_EXTRA_INDEX_URL : " https://dl.espressif.com/pypi"
0 commit comments