|
1 | 1 | name: Cron Build
|
2 | 2 |
|
3 |
| -on: |
| 3 | +on: |
4 | 4 | schedule:
|
5 | 5 | # ┌───────────── minute (0 - 59)
|
6 | 6 | # │ ┌───────────── hour (0 - 23)
|
7 | 7 | # │ │ ┌───────────── day of the month (1 - 31)
|
8 | 8 | # │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
|
9 | 9 | # │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
|
10 |
| -# │ │ │ │ │ |
| 10 | +# │ │ │ │ │ |
11 | 11 | # │ │ │ │ │
|
12 | 12 | # │ │ │ │ │
|
13 | 13 | # * * * * *
|
14 | 14 | - cron: '0 */6 * * *'
|
| 15 | + workflow_dispatch: |
| 16 | + inputs: |
| 17 | + idf_branch: |
| 18 | + description: 'IDF branch to build' |
| 19 | + required: true |
| 20 | + default: 'release/v5.1' |
| 21 | + target: |
| 22 | + description: 'Target to build' |
| 23 | + required: true |
| 24 | + default: 'all' |
15 | 25 |
|
16 | 26 | defaults:
|
17 | 27 | run:
|
18 | 28 | shell: bash
|
19 | 29 |
|
20 | 30 | jobs:
|
21 |
| - run: |
22 |
| - name: Build with IDF ${{ matrix.idf_branch }} |
| 31 | + build-libs: |
| 32 | + name: Build with IDF ${{ matrix.idf_branch }} for ${{ matrix.target }} |
23 | 33 | runs-on: ubuntu-latest
|
24 |
| - |
| 34 | + if: github.event_name == 'schedule' |
25 | 35 | strategy:
|
26 | 36 | fail-fast: false
|
27 | 37 | matrix:
|
28 | 38 | idf_branch: [release/v5.1, release/v4.4] #, release/v3.3]
|
| 39 | + target: [esp32, esp32s2, esp32s3, esp32c3] |
| 40 | + include: |
| 41 | + - idf_branch: release/v5.1 |
| 42 | + target: esp32c2 |
| 43 | + - idf_branch: release/v5.1 |
| 44 | + target: esp32c6 |
| 45 | + - idf_branch: release/v5.1 |
| 46 | + target: esp32h2 |
29 | 47 | steps:
|
30 | 48 | - uses: actions/checkout@v4
|
31 | 49 | with:
|
|
39 | 57 | GIT_COMMITTER_EMAIL: ${{ secrets.PUSH_EMAIL }}
|
40 | 58 | IDF_BRANCH: ${{ matrix.idf_branch }}
|
41 | 59 | run: |
|
42 |
| - git checkout ${{ matrix.idf_branch }} || echo "Using master branch" |
43 |
| - bash ./tools/cron.sh |
| 60 | + git checkout ${{ env.IDF_BRANCH }} || echo "Using master branch" |
| 61 | + if [ ! "$GITHUB_EVENT_NAME" == "schedule" ]; then |
| 62 | + echo "Wrong event '$GITHUB_EVENT_NAME'!" |
| 63 | + exit 1 |
| 64 | + fi |
| 65 | +
|
| 66 | + bash ./build.sh -e -t ${{ matrix.target }} |
| 67 | +
|
| 68 | + - name: Upload build |
| 69 | + if: failure() |
| 70 | + uses: actions/upload-artifact@v4 |
| 71 | + with: |
| 72 | + name: build-${{ matrix.idf_branch }}-${{ matrix.target }} |
| 73 | + path: build |
| 74 | + |
| 75 | + - name: Upload library files |
| 76 | + uses: actions/upload-artifact@v4 |
| 77 | + with: |
| 78 | + name: libs-${{ matrix.idf_branch }}-${{ matrix.target }} |
| 79 | + path: dist |
| 80 | + |
| 81 | + combine-artifacts: |
| 82 | + name: Combine artifacts for IDF ${{ matrix.idf_branch }} |
| 83 | + runs-on: ubuntu-latest |
| 84 | + if: github.event_name == 'schedule' |
| 85 | + needs: build-libs |
| 86 | + strategy: |
| 87 | + fail-fast: false |
| 88 | + matrix: |
| 89 | + idf_branch: [release/v5.1, release/v4.4] |
| 90 | + steps: |
| 91 | + - name: Download artifacts |
| 92 | + uses: actions/download-artifact@v4 |
| 93 | + with: |
| 94 | + path: dist |
| 95 | + pattern: libs-${{ matrix.idf_branch }}-* |
| 96 | + merge-multiple: true |
| 97 | + |
| 98 | + - name: Combine artifacts |
| 99 | + shell: bash |
| 100 | + run: | |
| 101 | + set -e |
| 102 | + mkdir -p out |
| 103 | + find dist -name 'arduino-esp32-libs-esp*.tar.gz' -exec tar zxvf {} -C out \; |
| 104 | + for file in $files; do |
| 105 | + tar zxvf $file -C out |
| 106 | + cat out/tools/esp32-arduino-libs/versions.txt >> out/tools/esp32-arduino-libs/versions_full.txt |
| 107 | + done |
| 108 | + awk -i inplace '!seen[$0]++' out/tools/esp32-arduino-libs/versions_full.txt |
| 109 | + mv -f out/tools/esp32-arduino-libs/versions_full.txt out/tools/esp32-arduino-libs/versions.txt |
| 110 | + cd out/tools/esp32-arduino-libs && tar zcf ../../../dist/esp32-arduino-libs.tar.gz * && cd ../../.. |
| 111 | + cp out/package_esp32_index.template.json dist/package_esp32_index.template.json |
| 112 | +
|
| 113 | + - name: Push changes |
| 114 | + if: ${{ github.repository == 'espressif/esp32-arduino-lib-builder' }} |
| 115 | + env: |
| 116 | + GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }} |
| 117 | + GIT_AUTHOR_EMAIL: ${{ secrets.PUSH_EMAIL }} |
| 118 | + GIT_COMMITTER_EMAIL: ${{ secrets.PUSH_EMAIL }} |
| 119 | + IDF_BRANCH: ${{ matrix.idf_branch }} |
| 120 | + run: | |
| 121 | + ./tools/push-to-arduino.sh |
| 122 | + if [ $? -ne 0 ]; then exit 1; fi |
| 123 | +
|
| 124 | + build-libs-dispatch: |
| 125 | + name: Dispatch build with IDF ${{ inputs.idf_branch }} |
| 126 | + runs-on: ubuntu-latest |
| 127 | + if: github.event_name == 'workflow_dispatch' |
| 128 | + steps: |
| 129 | + - uses: actions/checkout@v4 |
| 130 | + with: |
| 131 | + fetch-depth: 0 |
| 132 | + - name: Install dependencies |
| 133 | + run: bash ./tools/prepare-ci.sh |
| 134 | + - name: Build |
| 135 | + env: |
| 136 | + GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }} |
| 137 | + GIT_AUTHOR_EMAIL: ${{ secrets.PUSH_EMAIL }} |
| 138 | + GIT_COMMITTER_EMAIL: ${{ secrets.PUSH_EMAIL }} |
| 139 | + IDF_BRANCH: ${{ inputs.idf_branch }} |
| 140 | + run: | |
| 141 | + git checkout ${{ env.IDF_BRANCH }} || echo "Using master branch" |
| 142 | + if [ ! "$GITHUB_EVENT_NAME" == "schedule" ]; then |
| 143 | + echo "Wrong event '$GITHUB_EVENT_NAME'!" |
| 144 | + exit 1 |
| 145 | + fi |
| 146 | +
|
| 147 | + bash ./build.sh -d -t ${{ inputs.target }} |
44 | 148 | - name: Upload build
|
45 | 149 | if: failure()
|
46 | 150 | uses: actions/upload-artifact@v4
|
|
0 commit comments