S3 more settings #477
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 v3.x | |
on: [push, pull_request] | |
jobs: | |
build-esptool-binaries: | |
name: Build esptool binaries for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
include: | |
- os: macos-latest | |
TARGET: macos | |
- os: ubuntu-latest | |
TARGET: linux-amd64 | |
- os: windows-latest | |
TARGET: win64 | |
EXTEN: .exe | |
env: | |
DISTPATH: esptool-${{ matrix.TARGET }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller | |
pip install --user -e . | |
- 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 | |
./test/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 | |
- name: Build with PyInstaller | |
run: | | |
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=build_tools/espressif.ico esptool.py | |
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=build_tools/espressif.ico espefuse.py | |
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=build_tools/espressif.ico espsecure.py | |
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=build_tools/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: Add license and readme | |
shell: bash | |
run: cp 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/') | |
needs: build-esptool-binaries | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
VERSION: ${{ steps.get_version.outputs.VERSION }} | |
steps: | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Version ${{ github.ref }} | |
draft: true | |
prerelease: false | |
- name: Get version | |
id: get_version | |
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | |
shell: bash | |
upload_assets: | |
name: Upload release assets | |
if: startsWith(github.ref, 'refs/tags/') | |
needs: create_release | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
TARGET: [macos, linux-amd64, win64] | |
env: | |
DISTPATH: esptool-${{ needs.create_release.outputs.VERSION }}-${{ matrix.TARGET }} | |
steps: | |
- name: Download built binaries | |
uses: actions/download-artifact@v3 | |
- name: Rename and package binaries | |
run: | | |
mv esptool-${{ matrix.TARGET }} ${{ env.DISTPATH }} | |
zip -r ${{ env.DISTPATH }}.zip ./${{ env.DISTPATH }}/* | |
- name: Upload release assets | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.create_release.outputs.upload_url }} | |
asset_path: "${{ env.DISTPATH }}.zip" | |
asset_name: "${{ env.DISTPATH }}.zip" | |
asset_content_type: application/zip |