release multiple versions of the binary

This commit is contained in:
Victor Talpaert
2026-04-05 23:43:24 +02:00
parent 68d57307c2
commit ff0c00e3cf
4 changed files with 80 additions and 13 deletions

View File

@@ -6,10 +6,21 @@ on:
tags: ['*'] tags: ['*']
jobs: jobs:
build-and-release: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: strategy:
contents: write matrix:
include:
- name: esp32
target: esp32
led_builtin: 2
bsp_config_gpio: 9
board_specific_init: boards/default.h
- name: xiao-esp32c6
target: esp32c6
led_builtin: 8
bsp_config_gpio: 0
board_specific_init: boards/xiao_esp32c6.h
steps: steps:
- name: Checkout - name: Checkout
@@ -17,11 +28,35 @@ jobs:
with: with:
fetch-depth: 1 fetch-depth: 1
- name: Build firmware - name: Build firmware (${{ matrix.name }})
run: docker build -t esp-scope-firmware . run: |
docker build \
--build-arg TARGET=${{ matrix.target }} \
--build-arg LED_BUILTIN=${{ matrix.led_builtin }} \
--build-arg BSP_CONFIG_GPIO=${{ matrix.bsp_config_gpio }} \
--build-arg BOARD_SPECIFIC_INIT=${{ matrix.board_specific_init }} \
-t esp-scope-${{ matrix.name }} .
- name: Extract binary - name: Extract binary (${{ matrix.name }})
run: docker run --rm esp-scope-firmware cat /workspace/build/esp-scope.bin > esp-scope.bin run: |
docker run --rm esp-scope-${{ matrix.name }} \
cat /workspace/build/esp-scope.bin > esp-scope-${{ matrix.name }}.bin
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: esp-scope-${{ matrix.name }}
path: esp-scope-${{ matrix.name }}.bin
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Set release tag - name: Set release tag
id: tag id: tag
@@ -39,4 +74,31 @@ jobs:
with: with:
tag_name: ${{ steps.tag.outputs.tag }} tag_name: ${{ steps.tag.outputs.tag }}
prerelease: ${{ steps.tag.outputs.prerelease }} prerelease: ${{ steps.tag.outputs.prerelease }}
files: esp-scope.bin body: |
## Firmware binaries
| File | Board | Target | LED GPIO | AP-Mode button GPIO |
|------|-------|--------|----------|---------------------|
| `esp-scope-esp32.bin` | Generic ESP32 | esp32 | 2 | 9 |
| `esp-scope-xiao-esp32c6.bin` | Seeed XIAO ESP32C6 | esp32c6 | 8 (built-in yellow LED) | 0 (Boot button) |
## Flashing
### Browser (easiest)
Download the `.bin` for your board above, then flash it in your browser — no drivers or tools needed:
👉 **[https://www.espboards.dev/tools/program/](https://www.espboards.dev/tools/program/)**
Works with Chrome, Edge, or Opera. Connect your ESP via USB, click **Connect to ESP**, select the `.bin` file, and flash.
### Command line
```bash
esptool.py -p <PORT> write_flash 0x0 esp-scope-<variant>.bin
```
Replace `<PORT>` with your serial port (e.g. `/dev/ttyUSB0` or `COM3`).
files: |
esp-scope-esp32/esp-scope-esp32.bin
esp-scope-xiao-esp32c6/esp-scope-xiao-esp32c6.bin

View File

@@ -1,6 +1,7 @@
FROM espressif/idf:v5.5 AS firmware-builder FROM espressif/idf:v5.5 AS firmware-builder
SHELL ["/bin/bash", "-c"] SHELL ["/bin/bash", "-c"]
ARG TARGET=esp32
ARG LED_BUILTIN=2 ARG LED_BUILTIN=2
ARG BSP_CONFIG_GPIO=9 ARG BSP_CONFIG_GPIO=9
ARG BOARD_SPECIFIC_INIT="boards/default.h" ARG BOARD_SPECIFIC_INIT="boards/default.h"
@@ -12,4 +13,4 @@ WORKDIR /workspace
RUN sed -i "s/^CONFIG_LED_BUILTIN=.*/CONFIG_LED_BUILTIN=${LED_BUILTIN}/" sdkconfig.defaults && \ RUN sed -i "s/^CONFIG_LED_BUILTIN=.*/CONFIG_LED_BUILTIN=${LED_BUILTIN}/" sdkconfig.defaults && \
sed -i "s/^CONFIG_BSP_CONFIG_GPIO=.*/CONFIG_BSP_CONFIG_GPIO=${BSP_CONFIG_GPIO}/" sdkconfig.defaults && \ sed -i "s/^CONFIG_BSP_CONFIG_GPIO=.*/CONFIG_BSP_CONFIG_GPIO=${BSP_CONFIG_GPIO}/" sdkconfig.defaults && \
sed -i "s|^CONFIG_BOARD_SPECIFIC_INIT=.*|CONFIG_BOARD_SPECIFIC_INIT=\"${BOARD_SPECIFIC_INIT}\"|" sdkconfig.defaults sed -i "s|^CONFIG_BOARD_SPECIFIC_INIT=.*|CONFIG_BOARD_SPECIFIC_INIT=\"${BOARD_SPECIFIC_INIT}\"|" sdkconfig.defaults
RUN source /opt/esp/idf/export.sh > /dev/null 2>&1 && idf.py set-target esp32 && idf.py build RUN source /opt/esp/idf/export.sh > /dev/null 2>&1 && idf.py set-target ${TARGET} && idf.py build

View File

@@ -71,9 +71,10 @@ If you don't have ESP-IDF installed locally, you can build the firmware using th
Optionally override board-specific config values: Optionally override board-specific config values:
```bash ```bash
docker build \ docker build \
--build-arg TARGET=esp32c6 \
--build-arg LED_BUILTIN=8 \ --build-arg LED_BUILTIN=8 \
--build-arg BSP_CONFIG_GPIO=0 \ --build-arg BSP_CONFIG_GPIO=0 \
--build-arg BOARD_SPECIFIC_INIT="boards/xiao-esp32c6.h" \ --build-arg BOARD_SPECIFIC_INIT="boards/xiao_esp32c6.h" \
-t esp-scope-firmware . -t esp-scope-firmware .
``` ```

View File

@@ -40,11 +40,14 @@ static void start_webserver(void);
#define ADC_ATTEN ADC_ATTEN_DB_11 #define ADC_ATTEN ADC_ATTEN_DB_11
#define ADC_BIT_WIDTH ADC_BITWIDTH_12 #define ADC_BIT_WIDTH ADC_BITWIDTH_12
// TYPE2 is only available on newer chips (S3, C6, etc.). ESP32 (WROOM-32) requires TYPE1. // TYPE1 is used on original ESP32. Newer chips (S3, C6, etc.) use TYPE2.
// #define ADC_OUTPUT_TYPE ADC_DIGI_OUTPUT_FORMAT_TYPE2 #if defined(CONFIG_IDF_TARGET_ESP32)
// #define ADC_GET_DATA(p_data) ((p_data)->type2.data)
#define ADC_OUTPUT_TYPE ADC_DIGI_OUTPUT_FORMAT_TYPE1 #define ADC_OUTPUT_TYPE ADC_DIGI_OUTPUT_FORMAT_TYPE1
#define ADC_GET_DATA(p_data) ((p_data)->type1.data) #define ADC_GET_DATA(p_data) ((p_data)->type1.data)
#else
#define ADC_OUTPUT_TYPE ADC_DIGI_OUTPUT_FORMAT_TYPE2
#define ADC_GET_DATA(p_data) ((p_data)->type2.data)
#endif
/* /*
* Web Server Configuration * Web Server Configuration