|
7 | 7 | types: [published] |
8 | 8 | workflow_dispatch: |
9 | 9 |
|
| 10 | +env: |
| 11 | + # TODO: Update the below variables for your project |
| 12 | + APP_NAME: "Template" |
| 13 | + IDF_TARGET: 'esp32' |
| 14 | + IDF_VERSION: 'v5.5' |
| 15 | + IDF_COMPONENT_MANAGER: "1" # whether to enable the component manager or not |
| 16 | + FLASH_TOTAL_OVERRIDE: '1500000' # number of bytes of total flash (for percentage calculations) |
| 17 | + |
10 | 18 | jobs: |
11 | 19 | build: |
12 | 20 |
|
13 | 21 | runs-on: ubuntu-latest |
14 | 22 | continue-on-error: false |
15 | 23 |
|
| 24 | + permissions: |
| 25 | + contents: write |
| 26 | + |
16 | 27 | outputs: |
17 | 28 | zipfile-id: ${{ steps.zip_step.outputs.artifact-id }} |
18 | 29 |
|
19 | 30 | steps: |
20 | 31 | - name: Checkout repo |
21 | | - uses: actions/checkout@v4 |
| 32 | + uses: actions/checkout@v5 |
| 33 | + with: |
| 34 | + fetch-depth: 0 |
22 | 35 |
|
23 | 36 | - name: Build Main Code |
24 | 37 | uses: espressif/esp-idf-ci-action@v1 |
25 | 38 | with: |
26 | | - esp_idf_version: release-v5.5 |
| 39 | + esp_idf_version: ${{ env.IDF_VERSION }} |
27 | 40 | path: '.' |
28 | | - command: 'idf.py build' |
29 | | - # TODO: set the target here to be the chip you are building for |
30 | | - # target: esp32s3 |
| 41 | + target: ${{ env.IDF_TARGET }} |
31 | 42 |
|
32 | 43 | - name: Upload Build Outputs |
33 | 44 | uses: actions/upload-artifact@v4 |
|
60 | 71 | build/flasher_args.json |
61 | 72 | build/flash_args |
62 | 73 |
|
| 74 | + - name: Determine base ref |
| 75 | + if: ${{ github.event.release && github.event.action == 'published' }} |
| 76 | + id: base |
| 77 | + shell: bash |
| 78 | + run: | |
| 79 | + set -euo pipefail |
| 80 | + COMPARE_TAG_INPUT="${{ github.event.inputs.compare_tag || '' }}" |
| 81 | + if [ -n "$COMPARE_TAG_INPUT" ]; then |
| 82 | + echo "ref=$COMPARE_TAG_INPUT" >> "$GITHUB_OUTPUT" |
| 83 | + else |
| 84 | + # use the previous tag chronologically |
| 85 | + prev=$(git tag --sort=-creatordate | sed -n '2p') |
| 86 | + if [ -z "$prev" ]; then prev=$(git tag --sort=-v:refname | sed -n '2p'); fi |
| 87 | + echo "ref=$prev" >> "$GITHUB_OUTPUT" |
| 88 | + fi |
| 89 | +
|
| 90 | + - name: Determine Size Delta |
| 91 | + if: ${{ github.event.release && github.event.action == 'published' }} |
| 92 | + uses: esp-cpp/esp-idf-size-delta@v1 |
| 93 | + with: |
| 94 | + app_name: ${{ env.APP_NAME }} |
| 95 | + app_path: "." |
| 96 | + idf_target: ${{ env.IDF_TARGET }} |
| 97 | + idf_version: ${{ env.IDF_VERSION }} |
| 98 | + idf_component_manager: ${{ env.IDF_COMPONENT_MANAGER }} |
| 99 | + base_ref: ${{ steps.base.outputs.ref }} |
| 100 | + flash_total_override: ${{ env.FLASH_TOTAL_OVERRIDE }} |
| 101 | + post_comment: 'false' |
| 102 | + |
63 | 103 | package: |
64 | 104 | name: Package the binaries into an executables for Windows, MacOS, and Linux (Ubuntu) |
65 | 105 | needs: build |
|
0 commit comments