Skip to content

fix(esp32c5): Erase during flashing above 16MB #60

fix(esp32c5): Erase during flashing above 16MB

fix(esp32c5): Erase during flashing above 16MB #60

Workflow file for this run

name: Build esptool
on: [push, pull_request]
jobs:
build-esptool-binaries:
name: Build esptool binaries for ${{ matrix.platform }}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
platform: [windows-amd64, linux-amd64, macos-amd64, macos-arm64, linux-armv7, linux-aarch64]
include:
- platform: windows-amd64
runner: windows-latest
- platform: linux-amd64
runner: ubuntu-latest
- platform: macos-amd64
runner: macos-13
- platform: macos-arm64
runner: macos-latest
- platform: linux-armv7
runner: ubuntu-latest
- platform: linux-aarch64
runner: ubuntu-24.04-arm
env:
DISTPATH: esptool-${{ matrix.platform }}
STUBS_DIR: ./esptool/targets/stub_flasher/
EFUSE_DIR: ./espefuse/efuse_defs/
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
if: (matrix.platform != 'linux-armv7') || contains(github.ref_name, 'dev')
with:
python-version: "3.13"
# Python is used only to apply dev-release patch on Linux runners and no packages are installed as the build happens in the container
cache: ${{ matrix.platform != 'linux-armv7' && matrix.platform != 'linux-aarch64' && matrix.platform != 'linux-amd64' && 'pip' || '' }}
- name: Patch version for dev releases
if: contains(github.ref_name, 'dev')
run: |
echo "Patching version for dev release: ${{ github.ref_name }}"
python ci/patch_dev_release.py --version ${{ github.ref_name }} esptool/__init__.py
git diff
- name: Build with PyInstaller
uses: espressif/python-binary-action@master
with:
scripts: 'esptool.py espefuse.py espsecure.py esp_rfc2217_server.py'
output-dir: ./${{ env.DISTPATH }}
include-data-dirs: |
{
"esptool.py": [
"${{ env.STUBS_DIR }}1",
"${{ env.STUBS_DIR }}2"
],
"espefuse.py": [
"${{ env.EFUSE_DIR }}"
]
}
icon-file: ${{ matrix.platform == 'windows-amd64' && 'ci/espressif.ico' || '' }}
target-platform: ${{ matrix.platform }}
additional-arm-packages: 'openssl libffi-dev libssl-dev libffi7'
certificate: ${{ secrets.CERTIFICATE }}
certificate-password: ${{ secrets.CERTIFICATE_PASSWORD }}
- name: Add license and readme
shell: bash
run: mv LICENSE README.md ./${{ env.DISTPATH }}
- name: Archive artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.DISTPATH }}
path: ${{ env.DISTPATH }}
create_release:
name: Create GitHub release
if: startsWith(github.ref, 'refs/tags/') && !(contains(github.ref_name, 'dev'))
needs: [build-esptool-binaries]
runs-on: ubuntu-latest
env:
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi"
permissions:
contents: write
steps:
- name: Get version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
shell: bash
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 0
- name: Install dependencies
run: |
pip install --user -e ".[dev]"
- name: Generate changelog
run: |
cz changelog ${{ steps.get_version.outputs.VERSION }} --template ci/gh_changelog_template.md.j2 --file-name changelog_body.md
cat changelog_body.md
- name: Download built binaries
uses: actions/download-artifact@master
- name: Compress and rename binaries
run: |
for dir in esptool-*; do
if [[ "$dir" == esptool-win* ]]; then
zip -r "esptool-v${{ steps.get_version.outputs.VERSION }}-${dir#esptool-}.zip" "$dir"
else
chmod -R u=rwx,g=rx,o=rx "$dir"
tar -cvzf "esptool-v${{ steps.get_version.outputs.VERSION }}-${dir#esptool-}.tar.gz" "$dir"
fi
done
- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: changelog_body.md
name: Version ${{ steps.get_version.outputs.VERSION }}
draft: true
prerelease: false
files: |
esptool-v${{ steps.get_version.outputs.VERSION }}-*.zip
esptool-v${{ steps.get_version.outputs.VERSION }}-*.tar.gz