|
| 1 | +name: IDF v5.3 parallel build |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: # Manually start a workflow |
| 5 | + |
| 6 | +jobs: |
| 7 | + build-libs: |
| 8 | + name: Build Libs for ${{ matrix.target }} |
| 9 | + runs-on: macos-14 |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + target: [esp32, esp32s2, esp32s3, esp32c2, esp32c3, esp32c6, esp32h2, esp32p4] |
| 13 | + fail-fast: true |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + - name: Set up Python |
| 17 | + uses: actions/setup-python@v5 |
| 18 | + with: |
| 19 | + python-version: '3.11' |
| 20 | + - name: Install dependencies |
| 21 | + run: bash ./tools/prepare-ci.sh |
| 22 | + - name: Get current branch |
| 23 | + run: | |
| 24 | + echo "GIT_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV |
| 25 | + - name: Build Libs for ${{ matrix.target }} |
| 26 | + run: bash ./build.sh -e -t ${{ matrix.target }} |
| 27 | + - name: Upload artifacts for ${{ matrix.target }} |
| 28 | + uses: actions/upload-artifact@v4 |
| 29 | + with: |
| 30 | + name: artifacts-${{ matrix.target }} |
| 31 | + path: dist |
| 32 | + |
| 33 | + build-slave_firmware: |
| 34 | + name: Build Slave Firmware |
| 35 | + runs-on: macos-14 |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + - name: Set up Python |
| 39 | + uses: actions/setup-python@v5 |
| 40 | + with: |
| 41 | + python-version: '3.11' |
| 42 | + - name: Install dependencies |
| 43 | + run: bash ./tools/prepare-ci.sh |
| 44 | + - name: Build slave firmware |
| 45 | + run: | |
| 46 | + bash ./tools/compile_slave.sh |
| 47 | + - name: Upload artifacts |
| 48 | + uses: actions/upload-artifact@v4 |
| 49 | + with: |
| 50 | + name: slave_firmware |
| 51 | + path: wifi_copro_fw |
| 52 | + |
| 53 | + combine-artifacts: |
| 54 | + name: Combine artifacts and create framework |
| 55 | + needs: [build-libs, build-slave_firmware] |
| 56 | + runs-on: macos-14 |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@v4 |
| 59 | + - name: Set up Python |
| 60 | + uses: actions/setup-python@v5 |
| 61 | + with: |
| 62 | + python-version: '3.11' |
| 63 | + - name: Download build artifacts |
| 64 | + uses: actions/download-artifact@v4 |
| 65 | + with: |
| 66 | + path: dist |
| 67 | + pattern: artifacts-* |
| 68 | + merge-multiple: true |
| 69 | + - name: Download slave firmware |
| 70 | + uses: actions/download-artifact@v4 |
| 71 | + with: |
| 72 | + name: slave_firmware |
| 73 | + path: slave_firmware |
| 74 | + - name: Create complete framework |
| 75 | + run: | |
| 76 | + mkdir -p out dist/framework-arduinoespressif32 |
| 77 | + # Combine all target builds |
| 78 | + for zip_file in dist/artifacts-*/framework-arduinoespressif32-*.zip; do |
| 79 | + echo "Processing $zip_file" |
| 80 | + unzip -q "$zip_file" -d out |
| 81 | + done |
| 82 | + # Remove Arduino IDE specific files (not needed for PlatformIO) |
| 83 | + rm -f out/package_esp32_index.template.json |
| 84 | + # Copy framework files |
| 85 | + cp -r out/* dist/framework-arduinoespressif32/ |
| 86 | + # Integrate slave firmware directly |
| 87 | + mkdir -p dist/framework-arduinoespressif32/tools/slave_firmware |
| 88 | + cp -r slave_firmware/* dist/framework-arduinoespressif32/tools/slave_firmware/ |
| 89 | + # Create final framework ZIP |
| 90 | + (cd dist && zip -qr framework-arduinoespressif32.zip framework-arduinoespressif32) |
| 91 | +
|
| 92 | + - name: Upload framework artifact |
| 93 | + uses: actions/upload-artifact@v4 |
| 94 | + with: |
| 95 | + name: framework |
| 96 | + path: | |
| 97 | + dist/framework* |
| 98 | + dist/release-info.txt |
| 99 | +
|
| 100 | + release_framework: |
| 101 | + name: Release Framework |
| 102 | + needs: combine-artifacts |
| 103 | + runs-on: macos-14 |
| 104 | + steps: |
| 105 | + - uses: actions/checkout@v4 |
| 106 | + - name: Download complete framework |
| 107 | + uses: actions/download-artifact@v4 |
| 108 | + with: |
| 109 | + name: framework |
| 110 | + path: dist |
| 111 | + - name: Release |
| 112 | + |
| 113 | + with: |
| 114 | + tag_name: ${{ github.run_number }} |
| 115 | + body_path: dist/release-info.txt |
| 116 | + prerelease: true |
| 117 | + files: | |
| 118 | + dist/framework* |
| 119 | + dist/release-info.txt |
| 120 | + env: |
| 121 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments