9
9
- ' .github/**' # Ignore changes towards the .github directory
10
10
11
11
jobs :
12
- build-esptool-binaries-arm :
13
- name : Build esptool binaries for ${{ matrix.platform }}
14
- runs-on : ubuntu-latest
15
- strategy :
16
- matrix :
17
- platform : [armv7, aarch64]
18
- env :
19
- DISTPATH : esptool-${{ matrix.platform }}
20
- STUBS_DIR : ./esptool/targets/stub_flasher/
21
- EFUSE_DIR : ./espefuse/efuse_defs/
22
- PIP_EXTRA_INDEX_URL : " https://dl.espressif.com/pypi"
23
- steps :
24
- - name : Checkout repository
25
- uses : actions/checkout@v4
26
- - uses : uraimo/run-on-arch-action@v2
27
- name : Build and test in ${{ matrix.platform }}
28
- with :
29
- arch : ${{ matrix.platform }}
30
- distro : ubuntu22.04
31
- shell : /bin/bash
32
- # Not required, but speeds up builds by storing container images in
33
- # a GitHub package registry.
34
- githubToken : ${{ github.token }}
35
- # Create an artifacts directory
36
- setup : mkdir -p "${PWD}/${{ env.DISTPATH }}"
37
- dockerRunArgs : --volume "${PWD}/${{ env.DISTPATH }}:/${{ env.DISTPATH }}"
38
- install : |
39
- apt-get update -y
40
- apt-get install -y software-properties-common
41
- add-apt-repository -y ppa:deadsnakes/ppa
42
- apt-get update -y
43
- apt-get install --ignore-missing -y python3.11 python3.11-dev python3-pip pkg-config openssl libffi-dev libssl-dev cargo rustc
44
- python3.11 -m pip install --upgrade pip setuptools==74.1.3 wheel
45
- run : |
46
- python3.11 -m pip install --upgrade cffi
47
- adduser --disabled-password --gecos "" builder
48
- chmod -R a+rwx /home/runner/work/esptool
49
- su builder <<EOF
50
- export PATH=\$PATH:/home/builder/.local/bin
51
-
52
- # Patch version for dev releases
53
- if [[ "${{ github.ref_name }}" == *"dev"* ]]; then
54
- echo "Patching version for dev release: ${{ github.ref_name }}"
55
- python3.11 ci/patch_dev_release.py --version ${{ github.ref_name }} esptool/__init__.py
56
- git diff
57
- fi
58
-
59
- # Install dependencies
60
- python3.11 -m pip install pyinstaller==6.11.1
61
- python3.11 -m pip install --user -e .
62
-
63
- # Build with PyInstaller
64
- 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
65
- pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico --add-data="${{ env.EFUSE_DIR }}*.yaml:${{ env.EFUSE_DIR }}" espefuse.py
66
- pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico espsecure.py
67
- pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico esp_rfc2217_server.py
68
-
69
- # Test binaries
70
- ./${{ env.DISTPATH }}/esptool -h || exit 1
71
- ./${{ env.DISTPATH }}/espefuse -h || exit 1
72
- ./${{ env.DISTPATH }}/espsecure -h || exit 1
73
- ./${{ env.DISTPATH }}/esp_rfc2217_server -h || exit 1
74
-
75
- - name : Archive artifact
76
- uses : actions/upload-artifact@v4
77
- with :
78
- name : ${{ env.DISTPATH }}
79
- path : ${{ env.DISTPATH }}
80
-
81
12
build-esptool-binaries :
82
13
name : Build esptool binaries for ${{ matrix.platform }}
83
- runs-on : ${{ matrix.RUN_ON }}
14
+ runs-on : ${{ matrix.runner }}
84
15
strategy :
85
16
matrix :
86
- platform : [macos-amd64, macos-arm64, linux-amd64 ]
17
+ platform : [linux-amd64, macos-amd64, macos-arm64, linux-armv7, linux-aarch64 ]
87
18
include :
88
- - platform : macos-amd64
89
- TARGET : macos-amd64
90
- SEPARATOR : ' :'
91
- RUN_ON : macos-13 # Versions 13 and lower are Intel-based.
92
- - platform : macos-arm64
93
- TARGET : macos-arm64
94
- SEPARATOR : ' :'
95
- RUN_ON : macos-latest # Versions 14 and higher are ARM-based.
96
- # - platform: windows
97
- # TARGET: win64
98
- # EXTEN: .exe
99
- # SEPARATOR: ';'
100
- # RUN_ON: windows-latest
101
- - platform : linux-amd64
102
- TARGET : linux-amd64
103
- SEPARATOR : ' :'
104
- RUN_ON : ubuntu-22.04
19
+ # - platform: windows-amd64
20
+ # runner: windows-latest
21
+ - platform : linux-amd64
22
+ runner : ubuntu-latest
23
+ - platform : macos-amd64
24
+ runner : macos-13
25
+ - platform : macos-arm64
26
+ runner : macos-latest
27
+ - platform : linux-armv7
28
+ runner : ubuntu-latest
29
+ - platform : linux-aarch64
30
+ runner : ubuntu-24.04-arm
105
31
env :
106
- DISTPATH : esptool-${{ matrix.TARGET }}
32
+ DISTPATH : esptool-${{ matrix.platform }}
107
33
STUBS_DIR : ./esptool/targets/stub_flasher/
108
34
EFUSE_DIR : ./espefuse/efuse_defs/
109
- PIP_EXTRA_INDEX_URL : " https://dl.espressif.com/pypi"
110
35
steps :
111
36
- name : Checkout repository
112
37
uses : actions/checkout@v4
113
- - name : Set up Python 3.11
38
+
39
+ - name : Set up Python 3.13
114
40
uses : actions/setup-python@v5
41
+ if : (matrix.platform != 'linux-armv7') || contains(github.ref_name, 'dev')
115
42
with :
116
- python-version : 3.11
117
- - name : Update esptool version when releasing
118
- if : startsWith(github.ref, 'refs/tags/')
119
- run : |
120
- python ci/patch_release.py --version ${{ github.ref_name }} esptool/__init__.py
121
- #git diff
122
- - name : Install dependencies
123
- run : |
124
- python -m pip install --upgrade pip
125
- pip install pyinstaller==6.11.1
126
- pip install --user -e .
43
+ python-version : " 3.13"
44
+ # Python is used only to apply dev-release patch on Linux runners and no packages are installed as the build happens in the container
45
+ cache : ${{ matrix.platform != 'linux-armv7' && matrix.platform != 'linux-aarch64' && matrix.platform != 'linux-amd64' && 'pip' || '' }}
127
46
- name : Patch version for dev releases
128
47
if : contains(github.ref_name, 'dev')
129
48
run : |
130
49
echo "Patching version for dev release: ${{ github.ref_name }}"
131
50
python ci/patch_dev_release.py --version ${{ github.ref_name }} esptool/__init__.py
132
51
git diff
133
52
- name : Build with PyInstaller
134
- run : |
135
- pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico --add-data="${{ env.STUBS_DIR }}1/*.json${{ matrix.SEPARATOR }}${{ env.STUBS_DIR }}1/" --add-data="${{ env.STUBS_DIR }}2/*.json${{ matrix.SEPARATOR }}${{ env.STUBS_DIR }}2/" esptool.py
136
- pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico --add-data="${{ env.EFUSE_DIR }}*.yaml${{ matrix.SEPARATOR }}${{ env.EFUSE_DIR }}" espefuse.py
137
- pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico espsecure.py
138
- pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico esp_rfc2217_server.py
139
- - name : Sign binaries
140
- if : matrix.platform == 'windows' && github.event_name != 'pull_request' && github.repository == 'espressif/esptool'
141
- env :
142
- CERTIFICATE : ${{ secrets.CERTIFICATE }}
143
- CERTIFICATE_PASSWORD : ${{ secrets.CERTIFICATE_PASSWORD }}
144
- shell : pwsh
145
- run : |
146
- ./ci/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/esptool.exe
147
- ./ci/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/espefuse.exe
148
- ./ci/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/espsecure.exe
149
- ./ci/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/esp_rfc2217_server.exe
150
- - name : Test binaries
151
- shell : bash
152
- run : |
153
- ./${{ env.DISTPATH }}/esptool${{ matrix.EXTEN }} -h
154
- ./${{ env.DISTPATH }}/espefuse${{ matrix.EXTEN }} -h
155
- ./${{ env.DISTPATH }}/espsecure${{ matrix.EXTEN }} -h
156
- ./${{ env.DISTPATH }}/esp_rfc2217_server${{ matrix.EXTEN }} -h
53
+ uses : espressif/python-binary-action@master
54
+ with :
55
+ scripts : ' esptool.py espefuse.py espsecure.py esp_rfc2217_server.py'
56
+ output-dir : ./${{ env.DISTPATH }}
57
+ include-data-dirs : |
58
+ {
59
+ "esptool.py": [
60
+ "${{ env.STUBS_DIR }}1",
61
+ "${{ env.STUBS_DIR }}2"
62
+ ],
63
+ "espefuse.py": [
64
+ "${{ env.EFUSE_DIR }}"
65
+ ]
66
+ }
67
+ icon-file : ${{ matrix.platform == 'windows-amd64' && 'ci/espressif.ico' || '' }}
68
+ target-platform : ${{ matrix.platform }}
69
+ additional-arm-packages : ' openssl libffi-dev libssl-dev libffi7'
70
+ certificate : ${{ secrets.CERTIFICATE }}
71
+ certificate-password : ${{ secrets.CERTIFICATE_PASSWORD }}
72
+
157
73
- name : Archive artifact
158
74
uses : actions/upload-artifact@v4
159
75
with :
160
76
name : ${{ env.DISTPATH }}
161
77
path : ${{ env.DISTPATH }}
78
+ - name : Update esptool version when releasing
79
+ if : startsWith(github.ref, 'refs/tags/')
80
+ run : |
81
+ python ci/patch_release.py --version ${{ github.ref_name }} esptool/__init__.py
162
82
- name : Update package.json when a release tag is set
163
83
if : startsWith(github.ref, 'refs/tags/') && matrix.platform == 'linux-amd64'
164
84
run : |
@@ -196,7 +116,7 @@ jobs:
196
116
197
117
release :
198
118
name : Upload release binaries
199
- needs : [build-esptool-binaries, build-esptool-binaries-arm, push_stubs]
119
+ needs : [push_stubs]
200
120
if : startsWith(github.ref, 'refs/tags/')
201
121
runs-on : ubuntu-latest
202
122
steps :
@@ -213,12 +133,12 @@ jobs:
213
133
uses : actions/download-artifact@v4
214
134
- name : Rename and package binaries
215
135
run : |
216
- zip -r esptool-armv7.zip ./esptool-armv7
217
- zip -r esptool-aarch64.zip ./esptool-aarch64
136
+ zip -r esptool-linux- armv7.zip ./esptool-linux -armv7
137
+ zip -r esptool-linux- aarch64.zip ./esptool-linux -aarch64
218
138
zip -r esptool-macos-arm64.zip ./esptool-macos-arm64
219
139
zip -r esptool-macos-amd64.zip ./esptool-macos-amd64
220
140
zip -r esptool-linux-amd64.zip ./esptool-linux-amd64
221
- # zip -r esptool-win64 .zip ./esptool-win64
141
+ # zip -r esptool-windows-amd64 .zip ./esptool-windows-amd64
222
142
- name : Release
223
143
224
144
with :
0 commit comments