Skip to content

Commit d3ae621

Browse files
committed
Add build workflow and README
0 parents  commit d3ae621

File tree

2 files changed

+141
-0
lines changed

2 files changed

+141
-0
lines changed

.github/workflows/build.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Build ESP-Hosted Firmware
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ['v*']
7+
pull_request:
8+
workflow_dispatch:
9+
10+
env:
11+
ESP_IDF_VERSION: v5.5.1
12+
ESP_HOSTED_VERSION: "2.7.0"
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
target:
21+
- esp32
22+
- esp32c2
23+
- esp32c3
24+
- esp32c5
25+
- esp32c6
26+
- esp32c61
27+
- esp32s2
28+
- esp32s3
29+
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
34+
- name: Setup ESP-IDF
35+
uses: espressif/esp-idf-ci-action@v1
36+
with:
37+
esp_idf_version: ${{ env.ESP_IDF_VERSION }}
38+
target: ${{ matrix.target }}
39+
40+
- name: Create project from esp_hosted slave example
41+
run: |
42+
idf.py create-project-from-example "espressif/esp_hosted^${{ env.ESP_HOSTED_VERSION }}:slave"
43+
44+
- name: Build firmware
45+
working-directory: slave
46+
run: |
47+
idf.py set-target ${{ matrix.target }}
48+
idf.py build
49+
50+
- name: Prepare artifacts
51+
run: |
52+
mkdir -p artifacts
53+
cp slave/build/network_adapter.bin artifacts/network_adapter_${{ matrix.target }}.bin
54+
sha256sum artifacts/network_adapter_${{ matrix.target }}.bin > artifacts/network_adapter_${{ matrix.target }}.bin.sha256
55+
56+
- name: Upload artifacts
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: firmware-${{ matrix.target }}
60+
path: artifacts/
61+
62+
release:
63+
needs: build
64+
runs-on: ubuntu-latest
65+
if: startsWith(github.ref, 'refs/tags/v')
66+
permissions:
67+
contents: write
68+
69+
steps:
70+
- name: Download all artifacts
71+
uses: actions/download-artifact@v4
72+
with:
73+
path: firmware
74+
merge-multiple: true
75+
76+
- name: Create Release
77+
uses: softprops/action-gh-release@v2
78+
with:
79+
files: firmware/*
80+
generate_release_notes: true

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# ESP-Hosted Firmware
2+
3+
Pre-built [ESP-Hosted](https://github.com/espressif/esp-hosted) co-processor firmware binaries for use with ESPHome's [ESP32 Hosted](https://esphome.io/components/update/esp32_hosted/) component.
4+
5+
## Supported Targets
6+
7+
| Target | Status |
8+
|--------|--------|
9+
| ESP32 | Built |
10+
| ESP32-C2 | Built |
11+
| ESP32-C3 | Built |
12+
| ESP32-C5 | Built |
13+
| ESP32-C6 | Built |
14+
| ESP32-C61 | Built |
15+
| ESP32-S2 | Built |
16+
| ESP32-S3 | Built |
17+
18+
## Usage
19+
20+
1. Download the appropriate firmware binary for your co-processor from the [Releases](https://github.com/esphome/esp-hosted-firmware/releases) page
21+
2. Place the `.bin` file in your ESPHome configuration directory
22+
3. Configure the update component in your ESPHome YAML:
23+
24+
```yaml
25+
update:
26+
- platform: esp32_hosted
27+
firmware: coprocessor-firmware.bin
28+
# SHA256 hash from the .sha256 file
29+
expected_checksum: "abc123..."
30+
```
31+
32+
## Building Locally
33+
34+
To build the firmware locally:
35+
36+
```bash
37+
# Clone ESP-IDF
38+
git clone -b v5.5.1 --recursive https://github.com/espressif/esp-idf.git
39+
cd esp-idf
40+
./install.sh esp32c6 # or your target
41+
source export.sh
42+
cd ..
43+
44+
# Create project from ESP-Hosted example
45+
idf.py create-project-from-example "espressif/esp_hosted^2.7.0:slave"
46+
cd slave/
47+
48+
# Build for your target
49+
idf.py set-target esp32c6 # or your target
50+
idf.py build
51+
52+
# Output: build/network_adapter.bin
53+
```
54+
55+
## Versioning
56+
57+
Releases are tagged with the ESP-Hosted version used (e.g., `v2.7.0`).
58+
59+
## License
60+
61+
The ESP-Hosted firmware is licensed under the Apache License 2.0. See the [ESP-Hosted repository](https://github.com/espressif/esp-hosted) for details.

0 commit comments

Comments
 (0)