IDF v5.3 parallel build #58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: IDF v5.4 parallel build | |
on: | |
workflow_dispatch: # Manually start a workflow | |
jobs: | |
build-libs: | |
name: Build Libs for ${{ matrix.target }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: [esp32, esp32s2, esp32s3, esp32c2, esp32c3, esp32c6, esp32h2, esp32p4] | |
fail-fast: true | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: bash ./tools/prepare-ci.sh | |
- name: Get current branch | |
run: | | |
echo "GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV | |
- name: Build Libs for ${{ matrix.target }} | |
run: | | |
bash ./build.sh -e -t ${{ matrix.target }} | |
mv release-info.txt out/framework-arduinoespressif32 | |
- name: Upload artifacts for ${{ matrix.target }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifacts-${{ matrix.target }} | |
path: out/framework-arduinoespressif32 | |
build-slave_firmware: | |
name: Build Slave Firmware | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: bash ./tools/prepare-ci.sh | |
- name: Build slave firmware | |
run: bash ./tools/compile_slave.sh | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: slave_firmware | |
path: ./esp-hosted-mcu/slave/wifi_copro_fw | |
combine-artifacts: | |
name: Combine artifacts and create framework | |
needs: [build-libs, build-slave_firmware] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: framework-arduinoespressif32 | |
pattern: artifacts-* | |
merge-multiple: true | |
- name: Download slave firmware | |
uses: actions/download-artifact@v4 | |
with: | |
name: slave_firmware | |
path: slave_firmware | |
- name: Create complete framework | |
run: | | |
mkdir -p framework-arduinoespressif32/tools/slave_firmware | |
mv slave_firmware/* framework-arduinoespressif32/tools/slave_firmware/ | |
mv framework-arduinoespressif32/release-info.txt . | |
IDF_BRANCH=$(grep 'esp-idf branch' release-info.txt | sed -E 's/.*branch \[([^]]+)\].*/\1/') | |
IDF_COMMIT=$(grep 'esp-idf branch' release-info.txt | sed -E 's/.*commit \[([^]]+)\].*/\1/') | |
echo "IDF_BRANCH=$IDF_BRANCH" | |
echo "IDF_COMMIT=$IDF_COMMIT" | |
idf_version_string="${IDF_BRANCH//\//_}-$IDF_COMMIT" | |
# Update sdkconfig files with slave firmware version | |
if [ -f "framework-arduinoespressif32/tools/slave_firmware/coprocessor_fw_version.txt" ]; then | |
FIRMWARE_VERSION=$(cat framework-arduinoespressif32/tools/slave_firmware/coprocessor_fw_version.txt) | |
echo "Found firmware version: $FIRMWARE_VERSION" | |
# Array of MCU targets that need sdkconfig updates | |
mcu_targets=("esp32" "esp32s2" "esp32s3" "esp32c2" "esp32c3" "esp32c5" "esp32c6" "esp32h2" "esp32p4") | |
for mcu in "${mcu_targets[@]}"; do | |
sdkconfig_path="framework-arduinoespressif32/tools/esp32-arduino-libs/$mcu/sdkconfig" | |
if [ -f "$sdkconfig_path" ]; then | |
echo "Updating $sdkconfig_path with firmware version: $FIRMWARE_VERSION" | |
# Remove existing CONFIG_ESP_HOSTED_IDF_SLAVE_TARGET line and add new one at the beginning | |
sed -i -e '/^CONFIG_ESP_HOSTED_IDF_SLAVE_TARGET/d' -e "1i CONFIG_ESP_HOSTED_IDF_SLAVE_TARGET=\"$FIRMWARE_VERSION\"" "$sdkconfig_path" | |
else | |
echo "Warning: sdkconfig file not found at $sdkconfig_path" | |
fi | |
done | |
else | |
echo "Warning: coprocessor_fw_version.txt not found" | |
fi | |
7z a -mx=9 -tzip -xr'!.*' framework-arduinoespressif32-${idf_version_string}.zip framework-arduinoespressif32/ | |
- name: Set tag name | |
id: set_tag_name | |
run: | | |
IDF_VERSION=$(grep 'esp-idf branch' release-info.txt | sed -E 's/.*branch \[release\/v([0-9]+\.[0-9]+)\].*/\1/') | |
DATE=$(date +"%d%m-%H%M") | |
echo "tag_name=${DATE}-${IDF_VERSION}" >> $GITHUB_OUTPUT | |
- name: Release framework-arduinoespressif32 | |
uses: jason2866/[email protected] | |
with: | |
tag_name: ${{ steps.set_tag_name.outputs.tag_name }} | |
body_path: release-info.txt | |
prerelease: true | |
files: | | |
framework-arduinoespressif32-*.zip | |
release-info.txt | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |