Merge branch 'merge' into main_work #296
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: | |
workflow_dispatch: | |
push: | |
paths-ignore: | |
- '.github/**' # Ignore changes towards the .github directory | |
jobs: | |
build-esptool-binaries: | |
name: Build esptool binaries for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-14, macos-latest, ubuntu-latest, windows-latest] | |
include: | |
- os: macos-14 | |
TARGET: macos-arm | |
SEPARATOR: ':' | |
- os: macos-latest | |
TARGET: macos | |
SEPARATOR: ':' | |
- os: ubuntu-latest | |
TARGET: linux-amd64 | |
SEPARATOR: ':' | |
- os: windows-latest | |
TARGET: win64 | |
EXTEN: .exe | |
SEPARATOR: ';' | |
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.11 | |
uses: actions/setup-python@master | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller | |
pip install --user -e . | |
- name: Build with PyInstaller | |
run: | | |
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico --add-data="${{ env.STUBS_DIR }}*.json${{ matrix.SEPARATOR }}${{ env.STUBS_DIR }}" 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: 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: Archive artifact | |
uses: actions/upload-artifact@master | |
with: | |
name: ${{ env.DISTPATH }} | |
path: ${{ env.DISTPATH }} | |
- name: Build stub | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
export TOOLCHAIN_DIR=$HOME/toolchain | |
export ESP8266_BINDIR=$TOOLCHAIN_DIR/xtensa-lx106-elf/bin | |
export ESP32_BINDIR=$TOOLCHAIN_DIR/xtensa-esp32-elf/bin | |
export ESP32S2_BINDIR=$TOOLCHAIN_DIR/xtensa-esp32s2-elf/bin | |
export ESP32S3_BINDIR=$TOOLCHAIN_DIR/xtensa-esp32s3-elf/bin | |
export ESP32C3_BINDIR=$TOOLCHAIN_DIR/riscv32-esp-elf/bin | |
export PATH=$PATH:$ESP8266_BINDIR:$ESP32_BINDIR:$ESP32S2_BINDIR:$ESP32S3_BINDIR:$ESP32C3_BINDIR | |
./ci/setup_ci_build_env.sh | |
make -C flasher_stub V=1 | |
- name: Archive stubs artifact | |
if: matrix.os == 'ubuntu-latest' | |
uses: actions/upload-artifact@master | |
with: | |
name: stubs | |
path: /home/runner/work/esptool/esptool/flasher_stub/build | |
push_stubs: | |
name: Commit changed files | |
needs: build-esptool-binaries | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@master | |
with: | |
fetch-depth: 0 | |
- name: Download builded stubs | |
uses: actions/download-artifact@master | |
with: | |
name: stubs | |
path: ./mv_stubs | |
- name: Display structure of downloaded files | |
run: | | |
ls -R | |
- name: Move stubs in folder | |
run: | | |
rm ./esptool/targets/stub_flasher/* | |
cp -R ./mv_stubs/*.json ./esptool/targets/stub_flasher | |
ls -R ./esptool/targets/stub_flasher | |
rm -rf ./mv_stubs | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Stubs updated | |
release: | |
name: Upload release binaries | |
needs: build-esptool-binaries | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download built binaries | |
uses: actions/download-artifact@master | |
- name: Rename and package binaries | |
run: | | |
zip -r esptool-macos-arm.zip ./esptool-macos-arm | |
zip -r esptool-macos.zip ./esptool-macos | |
zip -r esptool-linux-amd64.zip ./esptool-linux-amd64 | |
zip -r esptool-win64.zip ./esptool-win64 | |
- name: Release | |
uses: jason2866/[email protected] | |
with: | |
tag_name: ${{ github.run_number }} | |
prerelease: true | |
files: | | |
*.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |