Skip to content

Commit 555e338

Browse files
committed
update runners to ubuntu 24.04 because Github is retiring 20.04
1 parent bf975a8 commit 555e338

File tree

4 files changed

+369
-23
lines changed

4 files changed

+369
-23
lines changed

.github/workflows/build.yml

+50-5
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,20 @@ jobs:
3535
# normal builds
3636
build_main:
3737
if: ${{ github.event_name != 'workflow_dispatch' || inputs.enable_main }}
38-
runs-on: ubuntu-20.04
38+
runs-on: ubuntu-24.04
3939
strategy:
4040
# devices to build for
4141
matrix:
42-
board: [LINUX, ESP32, ESP8266_BOARD, ESP8266_4MB, MICROBIT1, MICROBIT2, ESP32C3_IDF4, XIAOBLE]
42+
board: [LINUX, MICROBIT1, MICROBIT2, XIAOBLE]
4343
# try and build for all devices even if one fails
4444
fail-fast: false
4545
steps:
4646
- uses: actions/checkout@v4
4747
with:
4848
fetch-depth: 0
49+
- uses: actions/setup-python@v5
50+
with:
51+
python-version: 3.8
4952
- name: make ${{ matrix.board }}
5053
env:
5154
TRAVIS: 1
@@ -71,7 +74,7 @@ jobs:
7174
# Builds with DFU_UPDATE_BUILD=1
7275
build_dfu:
7376
if: ${{ github.event_name != 'workflow_dispatch' || inputs.enable_dfu }}
74-
runs-on: ubuntu-20.04
77+
runs-on: ubuntu-24.04
7578
strategy:
7679
# devices to build for
7780
matrix:
@@ -82,6 +85,9 @@ jobs:
8285
- uses: actions/checkout@v4
8386
with:
8487
fetch-depth: 0
88+
- uses: actions/setup-python@v5
89+
with:
90+
python-version: 3.8
8591
- name: make ${{ matrix.board }}
8692
env:
8793
TRAVIS: 1
@@ -106,7 +112,7 @@ jobs:
106112
# Builds with PAD_FOR_BOOTLOADER=1
107113
build_padded:
108114
if: ${{ github.event_name != 'workflow_dispatch' || inputs.enable_padded }}
109-
runs-on: ubuntu-20.04
115+
runs-on: ubuntu-24.04
110116
strategy:
111117
# devices to build for
112118
matrix:
@@ -117,6 +123,9 @@ jobs:
117123
- uses: actions/checkout@v4
118124
with:
119125
fetch-depth: 0
126+
- uses: actions/setup-python@v5
127+
with:
128+
python-version: 3.8
120129
- name: make ${{ matrix.board }}
121130
env:
122131
TRAVIS: 1
@@ -138,6 +147,42 @@ jobs:
138147
bin/*.tgz
139148
bin/*.zip
140149
150+
151+
# espressif builds - do not need python 3.8
152+
build_espressif:
153+
if: ${{ github.event_name != 'workflow_dispatch' || inputs.enable_main }}
154+
runs-on: ubuntu-24.04
155+
strategy:
156+
# devices to build for
157+
matrix:
158+
board: [ESP32, ESP8266_BOARD, ESP8266_4MB, ESP32C3_IDF4]
159+
# try and build for all devices even if one fails
160+
fail-fast: false
161+
steps:
162+
- uses: actions/checkout@v4
163+
with:
164+
fetch-depth: 0
165+
- name: make ${{ matrix.board }}
166+
env:
167+
TRAVIS: 1
168+
RELEASE: 1
169+
BOARD: ${{ matrix.board }}
170+
UPLOADTOKEN: ${{ secrets.UPLOADTOKEN }}
171+
run: |
172+
source ./scripts/provision.sh ${{ matrix.board }}
173+
make
174+
./scripts/ci_upload.sh
175+
- name: Upload ${{ matrix.board }} build artifact
176+
uses: actions/upload-artifact@v4.6.0
177+
with:
178+
name: ${{ matrix.board }}
179+
path: |
180+
bin/*.bin
181+
bin/*.uf2
182+
bin/*.hex
183+
bin/*.tgz
184+
bin/*.zip
185+
141186
# emulator builds
142187
build_emulator:
143188
if: ${{ github.event_name != 'workflow_dispatch' || inputs.enable_emulator }}
@@ -171,7 +216,7 @@ jobs:
171216
172217
# Disable doc building for now
173218
# docs:
174-
# runs-on: ubuntu-20.04
219+
# runs-on: ubuntu-24.04
175220
# steps:
176221
# - name: makedocs
177222
# run: make docs

make/targets/ESP8266.make

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ endif
3838

3939
LD_RENAME = --rename-section .text=.irom.text --rename-section .literal=.irom.literal
4040
ESP_COMBINED = $(PROJ_NAME)_combined_$(ESP_COMBINED_SIZE).bin
41-
APPGEN_TOOL = $(ESP8266_SDK_ROOT)/tools/gen_appbin.py
41+
APPGEN_TOOL = targets/esp8266/gen_appbin_python3.py
4242
BOOTLOADER = $(ESP8266_SDK_ROOT)/bin/boot_v1.6.bin
4343
BLANK = $(ESP8266_SDK_ROOT)/bin/blank.bin
4444
INIT_DATA = $(ESP8266_SDK_ROOT)/bin/esp_init_data_default.bin
@@ -83,7 +83,7 @@ $(USER1_BIN): $(USER1_ELF)
8383
$(Q)$(OBJCOPY) --only-section .rodata -O binary $(USER1_ELF) eagle.app.v6.rodata.bin
8484
$(Q)$(OBJCOPY) --only-section .irom0.text -O binary $(USER1_ELF) eagle.app.v6.irom0text.bin
8585
@ls -ls eagle*bin
86-
$(Q)COMPILE=gcc python2.7 $(APPGEN_TOOL) $(USER1_ELF) 2 $(ESP_FLASH_MODE) $(ESP_FLASH_FREQ_DIV) $(ESP_FLASH_SIZE) 0 >/dev/null
86+
$(Q)COMPILE=gcc python $(APPGEN_TOOL) $(USER1_ELF) 2 $(ESP_FLASH_MODE) $(ESP_FLASH_FREQ_DIV) $(ESP_FLASH_SIZE) 0 >/dev/null
8787
$(Q) rm -f eagle.app.v6.*.bin
8888
$(Q) mv eagle.app.flash.bin $@
8989
@echo "** user1.bin uses $$( stat $(STAT_FLAGS) $@) bytes of" $(ESP_FLASH_MAX) "available"
@@ -97,7 +97,7 @@ $(USER2_BIN): $(USER2_ELF) $(USER1_BIN)
9797
$(Q)$(OBJCOPY) --only-section .data -O binary $(USER2_ELF) eagle.app.v6.data.bin
9898
$(Q)$(OBJCOPY) --only-section .rodata -O binary $(USER2_ELF) eagle.app.v6.rodata.bin
9999
$(Q)$(OBJCOPY) --only-section .irom0.text -O binary $(USER2_ELF) eagle.app.v6.irom0text.bin
100-
$(Q)COMPILE=gcc python2.7 $(APPGEN_TOOL) $(USER2_ELF) 2 $(ESP_FLASH_MODE) $(ESP_FLASH_FREQ_DIV) $(ESP_FLASH_SIZE) 1 >/dev/null
100+
$(Q)COMPILE=gcc python $(APPGEN_TOOL) $(USER2_ELF) 2 $(ESP_FLASH_MODE) $(ESP_FLASH_FREQ_DIV) $(ESP_FLASH_SIZE) 1 >/dev/null
101101
$(Q) rm -f eagle.app.v6.*.bin
102102
$(Q) mv eagle.app.flash.bin $@
103103

scripts/provision.sh

+29-15
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,17 @@ fi
6767
echo Provision BOARDNAME = $BOARDNAME
6868
echo Provision FAMILY = $FAMILY
6969

70+
if pip --version 2>/dev/null; then
71+
echo Python/pip installed
72+
else
73+
echo Installing python/pip
74+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -qq -y python python3-pip
75+
fi
76+
echo Python version `python --version`
77+
7078
if [ "$PROVISION_ESP32" = "1" ]; then
7179
echo ===== ESP32
7280
# needed for esptool for merging binaries
73-
if pip --version 2>/dev/null; then
74-
echo python/pip installed
75-
else
76-
echo Installing python/pip pyserial
77-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -qq -y python python3-pip
78-
fi
7981
if pip list 2>/dev/null | grep pyserial >/dev/null; then
8082
echo pyserial installed;
8183
else
@@ -163,16 +165,28 @@ fi
163165
#--------------------------------------------------------------------------------
164166
if [ "$PROVISION_NRF52" = "1" ]; then
165167
echo ===== NRF52
166-
if ! type pip 2> /dev/null > /dev/null; then
167-
echo Installing python and pip
168-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -qq -y python python-pip
169-
fi
170168
if ! type nrfutil 2> /dev/null > /dev/null; then
171-
echo Installing nrfutil
172-
sudo pip install --ignore-installed nrfutil protobuf==3.17.3
169+
#echo Installing nrfutil
170+
#sudo pip install --ignore-installed nrfutil nrfutil
173171
# --ignore-installed is used because pip 10 fails because PyYAML was already installed by the system
174-
# protobuf-3.17.3 is required because it seems protobuf-3.18 which auto-installs as of ~15 sept 2021 is incompatible with Python 2.7
175-
# -q can be used to silence the above
172+
173+
# we need pipx and python 3.8 to allow us to run nrfutil under a python that's not the current version
174+
if pipx --version 2>/dev/null; then
175+
echo pipx installed
176+
else
177+
echo Installing pipx
178+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -qq -y pipx
179+
fi
180+
# we need python3.8 for nrfutil
181+
if python3.8 --version 2>/dev/null; then
182+
echo Python 3.8 installed
183+
else
184+
echo Installing python3.8
185+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -qq -y python3.8
186+
fi
187+
# Because nrfutil doesn't support the latest version of python! Yay!
188+
echo Installing nrfutil
189+
sudo pipx install nrfutil --python `which python3.8`
176190
fi
177191
ARM=1
178192

@@ -309,4 +323,4 @@ if [ "$PROVISION_EMSCRIPTEN" = "1" ] || [ "$PROVISION_EMSCRIPTEN2" = "1" ]; then
309323
./targetlibs/emscripten/emsdk/emsdk activate $EMSCRIPTEN_VERSION
310324
source ./targetlibs/emscripten/emsdk/emsdk_env.sh
311325
fi
312-
#--------------------------------------------------------------------------------
326+
#--------------------------------------------------------------------------------

0 commit comments

Comments
 (0)