Compare commits
56
Commits
dcbc700ce7
..
v0.0.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a0472e406 | ||
|
|
a9353e5c10 | ||
|
|
434b3c5df5 | ||
|
|
62cb4c6f06 | ||
|
|
28638b99f1 | ||
|
|
872e9bcb78 | ||
|
|
ac3a1f20b5 | ||
|
|
2537dba07a | ||
|
|
35602fb877 | ||
|
|
2ca785d6b2 | ||
|
|
192f2b1b21 | ||
|
|
2864c8289f | ||
|
|
be300f11ce | ||
|
|
fc4064d659 | ||
|
|
5fd7a23c38 | ||
|
|
a5d3120f3e | ||
|
|
dfba9a76d0 | ||
|
|
5973883a9b | ||
|
|
e47cf850e0 | ||
|
|
efb019f623 | ||
|
|
3d694be8a6 | ||
|
|
4b663faa7f | ||
|
|
2a4806eca5 | ||
|
|
e7553da18e | ||
|
|
b8ba94a78f | ||
|
|
415a64cba5 | ||
|
|
bd28b1a4b0 | ||
|
|
c6cb8fe2f0 | ||
|
|
134ac88cf0 | ||
|
|
2ef8fd4de8 | ||
|
|
33c4e1f8a2 | ||
|
|
be48b7601b | ||
|
|
ec4a0334f3 | ||
|
|
b8aac5c769 | ||
|
|
8de01c486c | ||
|
|
dbc20be3c7 | ||
|
|
c55952e84d | ||
|
|
d2413610ec | ||
|
|
c770c179b5 | ||
|
|
3cfa014200 | ||
|
|
d4eee81dba | ||
|
|
7acf008d8e | ||
|
|
a4e792b3c2 | ||
|
|
3ec593b2f6 | ||
|
|
20a7dc1d40 | ||
|
|
72f2566fe1 | ||
|
|
eeca3ea74d | ||
|
|
68909c4b73 | ||
|
|
e356794c79 | ||
|
|
a2c5d714bf | ||
|
|
69fbd04b53 | ||
|
|
eb62f27485 | ||
|
|
42dba0b758 | ||
|
|
f5fa26e196 | ||
|
|
6b37937b38 | ||
|
|
bf127eae13 |
@@ -0,0 +1,62 @@
|
|||||||
|
name: "Espressif IoT Development Framework (ESP-IDF)"
|
||||||
|
description: "This action builds your firmware for ESP32 directly in GitHub using Espressif ESP-IDF Docker image."
|
||||||
|
branding:
|
||||||
|
color: red
|
||||||
|
icon: wifi
|
||||||
|
inputs:
|
||||||
|
path:
|
||||||
|
description: "Relative path under $GITHUB_WORKSPACE containing the project"
|
||||||
|
default: "."
|
||||||
|
required: false
|
||||||
|
esp_idf_version:
|
||||||
|
default: "latest"
|
||||||
|
required: false
|
||||||
|
esp_idf_docker_image:
|
||||||
|
default: "espressif/idf"
|
||||||
|
required: false
|
||||||
|
extra_docker_args:
|
||||||
|
default: ""
|
||||||
|
required: false
|
||||||
|
target:
|
||||||
|
default: "esp32"
|
||||||
|
required: false
|
||||||
|
command:
|
||||||
|
default: "idf.py build"
|
||||||
|
required: false
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- shell: bash
|
||||||
|
env:
|
||||||
|
INPUT_PATH: ${{ inputs.path }}
|
||||||
|
INPUT_TARGET: ${{ inputs.target }}
|
||||||
|
INPUT_VERSION: ${{ inputs.esp_idf_version }}
|
||||||
|
INPUT_IMAGE: ${{ inputs.esp_idf_docker_image }}
|
||||||
|
INPUT_EXTRA: ${{ inputs.extra_docker_args }}
|
||||||
|
INPUT_COMMAND: ${{ inputs.command }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
IDF_TARGET=$(echo "$INPUT_TARGET" | tr '[:upper:]' '[:lower:]' | tr -d '_-')
|
||||||
|
WORKDIR="/project/${INPUT_PATH}"
|
||||||
|
|
||||||
|
CID=$(docker create -t \
|
||||||
|
-e IDF_TARGET="$IDF_TARGET" \
|
||||||
|
-w "$WORKDIR" \
|
||||||
|
$INPUT_EXTRA \
|
||||||
|
"${INPUT_IMAGE}:${INPUT_VERSION}" \
|
||||||
|
/bin/bash -c "git config --global --add safe.directory '*' && ${INPUT_COMMAND}")
|
||||||
|
|
||||||
|
cleanup() { docker rm -f "$CID" >/dev/null 2>&1 || true; }
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
|
docker cp "$GITHUB_WORKSPACE/." "$CID:/project"
|
||||||
|
|
||||||
|
status=0
|
||||||
|
docker start -a "$CID" || status=$?
|
||||||
|
|
||||||
|
# copy build output back so later steps (artifact upload etc.) can use it
|
||||||
|
mkdir -p "$GITHUB_WORKSPACE/${INPUT_PATH}"
|
||||||
|
docker cp "$CID:$WORKDIR/build/." "$GITHUB_WORKSPACE/${INPUT_PATH}/build" 2>/dev/null || true
|
||||||
|
|
||||||
|
exit $status
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: 'recursive'
|
||||||
|
- name: esp-idf build
|
||||||
|
uses: ./.gitea/actions/esp-idf-ci-action
|
||||||
|
with:
|
||||||
|
esp_idf_version: v6.0.2
|
||||||
|
target: esp32c6
|
||||||
|
|
||||||
|
- name: Package firmware
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
NAME="firmware-${GITHUB_REF_NAME}"
|
||||||
|
mkdir -p "release/${NAME}/build/bootloader" "release/${NAME}/build/partition_table"
|
||||||
|
|
||||||
|
# Keep the build/ layout so "@flash_args" works after unzipping
|
||||||
|
cp build/bootloader/bootloader.bin "release/${NAME}/build/bootloader/"
|
||||||
|
cp build/partition_table/partition-table.bin "release/${NAME}/build/partition_table/"
|
||||||
|
cp "build/${PROJECT_BIN}" "release/${NAME}/build/"
|
||||||
|
cp build/flash_args "release/${NAME}/build/"
|
||||||
|
(cd release && zip -qr "${NAME}.zip" "${NAME}")
|
||||||
|
|
||||||
|
# Standalone copies
|
||||||
|
cp build/bootloader/bootloader.bin release/
|
||||||
|
cp build/partition_table/partition-table.bin release/
|
||||||
|
cp "build/${PROJECT_BIN}" release/
|
||||||
|
|
||||||
|
cat > release/notes.md <<EOF
|
||||||
|
## Flashing (${CHIP})
|
||||||
|
|
||||||
|
Requires [esptool](https://github.com/espressif/esptool) (\`pip install esptool\`).
|
||||||
|
|
||||||
|
**Option 1: with the individual files**
|
||||||
|
|
||||||
|
\`\`\`
|
||||||
|
python -m esptool --chip ${CHIP} -b 460800 --before default-reset --after hard-reset write-flash --flash-mode dio --flash-size 4MB --flash-freq 80m 0x0 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/${PROJECT_BIN}
|
||||||
|
\`\`\`
|
||||||
|
|
||||||
|
**Option 2: unzip \`${NAME}.zip\`, then from inside its \`build\` directory**
|
||||||
|
|
||||||
|
\`\`\`
|
||||||
|
python -m esptool --chip ${CHIP} -b 460800 --before default-reset --after hard-reset write-flash "@flash_args"
|
||||||
|
\`\`\`
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: Create release
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ github.ref }}
|
||||||
|
release_name: Release ${{ github.ref_name }}
|
||||||
|
body_path: release/notes.md
|
||||||
|
draft: false
|
||||||
|
prerelease: true
|
||||||
|
|
||||||
|
# actions/upload-release-asset relies on GitHub's templated upload_url, which Gitea
|
||||||
|
# doesn't provide, so attach the files through Gitea's API. The release ID is looked
|
||||||
|
# up by tag rather than taken from the step's outputs, because the old toolkit inside
|
||||||
|
# actions/create-release may emit outputs in a format Gitea's runner doesn't parse.
|
||||||
|
- name: Upload release assets
|
||||||
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
API="${GITHUB_API_URL:-${GITHUB_SERVER_URL}/api/v1}/repos/${GITHUB_REPOSITORY}"
|
||||||
|
|
||||||
|
RELEASE_ID=$(curl -fsS -H "Authorization: token ${TOKEN}" \
|
||||||
|
"${API}/releases/tags/${GITHUB_REF_NAME}" | jq -r .id)
|
||||||
|
|
||||||
|
for f in release/firmware-*.zip release/bootloader.bin release/partition-table.bin "release/${PROJECT_BIN}"; do
|
||||||
|
echo "Uploading $(basename "$f")"
|
||||||
|
curl -fsS -X POST "${API}/releases/${RELEASE_ID}/assets?name=$(basename "$f")" \
|
||||||
|
-H "Authorization: token ${TOKEN}" \
|
||||||
|
-F "attachment=@${f}" >/dev/null
|
||||||
|
done
|
||||||
@@ -17,6 +17,8 @@ const char *test = "amai zeg\n";
|
|||||||
#define NODE_NUMBER 1
|
#define NODE_NUMBER 1
|
||||||
#define TOTAL_NUMBER_OF_NODES 4
|
#define TOTAL_NUMBER_OF_NODES 4
|
||||||
|
|
||||||
|
// testing if the release packaging works v2
|
||||||
|
|
||||||
|
|
||||||
uint8_t node_mac[ESP_NOW_ETH_ALEN] = {0xDE, 0xD5, 0xEC, 0x00, 0x00, 0x02};
|
uint8_t node_mac[ESP_NOW_ETH_ALEN] = {0xDE, 0xD5, 0xEC, 0x00, 0x00, 0x02};
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
name: Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repo
|
|
||||||
uses: https://github.com/actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: 'recursive'
|
|
||||||
|
|
||||||
- name: esp-idf build
|
|
||||||
uses: https://github.com/espressif/esp-idf-ci-action@v1
|
|
||||||
with:
|
|
||||||
esp_idf_version: v4.4
|
|
||||||
target: esp32s2
|
|
||||||
path: '.'
|
|
||||||
Reference in New Issue
Block a user