fix(esp32-c6): Disable RTC WDT reset to prevent port disappearing #634
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build esptool | |
on: [push, pull_request] | |
jobs: | |
build-esptool-binaries-arm: | |
name: Build esptool binaries for ${{ matrix.platform }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: [armv7, aarch64] | |
env: | |
DISTPATH: esptool-${{ matrix.platform }} | |
STUBS_DIR: ./esptool/targets/stub_flasher/ | |
EFUSE_DIR: ./espefuse/efuse_defs/ | |
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@master | |
- uses: uraimo/run-on-arch-action@v2 | |
name: Build and test in ${{ matrix.platform }} | |
with: | |
distro: ubuntu20.04 | |
shell: /bin/bash | |
# Not required, but speeds up builds by storing container images in | |
# a GitHub package registry. | |
githubToken: ${{ github.token }} | |
# Create an artifacts directory | |
setup: mkdir -p "${PWD}/${{ env.DISTPATH }}" | |
dockerRunArgs: --volume "${PWD}/${{ env.DISTPATH }}:/${{ env.DISTPATH }}" | |
install: | | |
apt-get update -y | |
apt-get install -y python3 python3-pip python3-setuptools libffi-dev | |
run: | | |
adduser --disabled-password --gecos "" builder | |
chmod -R a+rwx /home/runner/work/esptool | |
su builder <<EOF | |
export PATH=\$PATH:/home/builder/.local/bin | |
# Install dependencies | |
python -m pip install --upgrade pip | |
# PyInstaller >=6.0 results in significantly more antivirus false positives | |
pip install pyinstaller==5.13.2 | |
pip install --user -e . | |
# Build with PyInstaller | |
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico --add-data="${{ env.STUBS_DIR }}1/*.json:${{ env.STUBS_DIR }}1/" --add-data="${{ env.STUBS_DIR }}2/*.json:${{ env.STUBS_DIR }}2/" esptool.py | |
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico --add-data="${{ env.EFUSE_DIR }}*.yaml:${{ env.EFUSE_DIR }}" espefuse.py | |
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico espsecure.py | |
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico esp_rfc2217_server.py | |
# Test binaries | |
./${{ env.DISTPATH }}/esptool -h | |
./${{ env.DISTPATH }}/espefuse -h | |
./${{ env.DISTPATH }}/espsecure -h | |
./${{ env.DISTPATH }}/esp_rfc2217_server -h | |
# Add license and readme | |
mv LICENSE README.md ./${{ env.DISTPATH }} | |
- name: Archive artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: ${{ env.DISTPATH }} | |
path: ${{ env.DISTPATH }} | |
build-esptool-binaries: | |
name: Build esptool binaries for ${{ matrix.platform }} | |
runs-on: ${{ matrix.RUN_ON }} | |
strategy: | |
matrix: | |
platform: [macos-amd64, macos-arm64, windows, linux-amd64] | |
include: | |
- platform: macos-amd64 | |
TARGET: macos-amd64 | |
SEPARATOR: ':' | |
RUN_ON: macos-13 # Versions 13 and lower are Intel-based. | |
- platform: macos-arm64 | |
TARGET: macos-arm64 | |
SEPARATOR: ':' | |
RUN_ON: macos-latest # Versions 14 and higher are ARM-based. | |
- platform: windows | |
TARGET: win64 | |
EXTEN: .exe | |
SEPARATOR: ';' | |
RUN_ON: windows-latest | |
- platform: linux-amd64 | |
TARGET: linux-amd64 | |
SEPARATOR: ':' | |
RUN_ON: ubuntu-20.04 | |
env: | |
DISTPATH: esptool-${{ matrix.TARGET }} | |
STUBS_DIR: ./esptool/targets/stub_flasher/ | |
EFUSE_DIR: ./espefuse/efuse_defs/ | |
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@master | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@master | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
# PyInstaller >=6.0 results in significantly more antivirus false positives | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller==5.13.2 | |
pip install --user -e . | |
- name: Build with PyInstaller | |
run: | | |
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico --add-data="${{ env.STUBS_DIR }}1/*.json${{ matrix.SEPARATOR }}${{ env.STUBS_DIR }}1/" --add-data="${{ env.STUBS_DIR }}2/*.json${{ matrix.SEPARATOR }}${{ env.STUBS_DIR }}2/" esptool.py | |
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico --add-data="${{ env.EFUSE_DIR }}*.yaml${{ matrix.SEPARATOR }}${{ env.EFUSE_DIR }}" espefuse.py | |
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico espsecure.py | |
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico esp_rfc2217_server.py | |
- name: Sign binaries | |
if: matrix.platform == 'windows' && github.event_name != 'pull_request' | |
env: | |
CERTIFICATE: ${{ secrets.CERTIFICATE }} | |
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }} | |
shell: pwsh | |
run: | | |
./ci/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/esptool.exe | |
./ci/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/espefuse.exe | |
./ci/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/espsecure.exe | |
./ci/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/esp_rfc2217_server.exe | |
- name: Test binaries | |
shell: bash | |
run: | | |
./${{ env.DISTPATH }}/esptool${{ matrix.EXTEN }} -h | |
./${{ env.DISTPATH }}/espefuse${{ matrix.EXTEN }} -h | |
./${{ env.DISTPATH }}/espsecure${{ matrix.EXTEN }} -h | |
./${{ env.DISTPATH }}/esp_rfc2217_server${{ matrix.EXTEN }} -h | |
- name: Add license and readme | |
shell: bash | |
run: mv LICENSE README.md ./${{ env.DISTPATH }} | |
- name: Archive artifact | |
uses: actions/upload-artifact@master | |
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, build-esptool-binaries-arm] | |
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: | | |
python -m pip install --upgrade pip | |
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 |