Skip to content

Commit f7d64cf

Browse files
committed
update to calculate size in package_main
1 parent 8d2ccde commit f7d64cf

File tree

3 files changed

+31
-56
lines changed

3 files changed

+31
-56
lines changed

.github/workflows/idf_size_release.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

.github/workflows/package_main.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
steps:
2020
- name: Checkout repo
2121
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
2224

2325
- name: Build Main Code
2426
uses: espressif/esp-idf-ci-action@v1
@@ -60,6 +62,35 @@ jobs:
6062
build/flasher_args.json
6163
build/flash_args
6264
65+
- name: Determine base ref
66+
if: ${{ github.event.release && github.event.action == 'published' }}
67+
id: base
68+
shell: bash
69+
run: |
70+
set -euo pipefail
71+
COMPARE_TAG_INPUT="${{ github.event.inputs.compare_tag || '' }}"
72+
if [ -n "$COMPARE_TAG_INPUT" ]; then
73+
echo "ref=$COMPARE_TAG_INPUT" >> "$GITHUB_OUTPUT"
74+
else
75+
# use the previous tag chronologically
76+
prev=$(git tag --sort=-creatordate | sed -n '2p')
77+
if [ -z "$prev" ]; then prev=$(git tag --sort=-v:refname | sed -n '2p'); fi
78+
echo "ref=$prev" >> "$GITHUB_OUTPUT"
79+
fi
80+
81+
- name: Determine Size Delta
82+
if: ${{ github.event.release && github.event.action == 'published' }}
83+
uses: esp-cpp/esp-idf-size-delta@main
84+
with:
85+
app_name: ${{ env.APP_NAME }}
86+
app_path: "."
87+
idf_target: ${{ env.IDF_TARGET }}
88+
idf_version: ${{ env.IDF_VERSION }}
89+
idf_component_manager: ${{ env.IDF_COMPONENT_MANAGER }}
90+
base_ref: ${{ steps.base.outputs.ref }}
91+
flash_total_override: ${{ env.FLASH_TOTAL_OVERRIDE }}
92+
post_comment: 'false'
93+
6394
package:
6495
name: Package the binaries into an executables for Windows, MacOS, and Linux (Ubuntu)
6596
needs: build

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ After setting this as the template, make sure to update the following:
4242
your project / processor.
4343
- Update the [./.github/workflows/build.yml](./.github/workflows/build.yml) file
4444
to have the correct information for your project.
45-
- Update the [./.github/workflows/idf_size_release.yml](./.github/workflows/idf_size_release.yml) file
46-
to have the correct information for your project.
4745
- Update the [./.github/workflows/package_main.yml](./.github/workflows/package_main.yml) file
4846
to:
4947
- have the correct target architecture (e.g. `esp32s3`) for your project

0 commit comments

Comments
 (0)