Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tasmota #5

Merged
merged 8 commits into from
Dec 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 69 additions & 15 deletions .github/workflows/build_esptool.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
name: Build esptool

on: [push, pull_request]
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-latest, ubuntu-latest, windows-latest]
os: [macos-10.15, ubuntu-latest, windows-latest]
include:
- os: macos-latest
- os: macos-10.15
TARGET: macos
SEPARATOR: ':'
- os: ubuntu-latest
Expand All @@ -35,23 +39,30 @@ jobs:
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
./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=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 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.os == 'windows-latest' && 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: |
Expand All @@ -61,13 +72,56 @@ jobs:
./${{ env.DISTPATH }}/esp_rfc2217_server${{ matrix.EXTEN }} -h
- name: Add license and readme
shell: bash
run: mv LICENSE README.md ./${{ env.DISTPATH }}
run: cp LICENSE README.md ./${{ env.DISTPATH }}
- name: Archive artifact
uses: actions/upload-artifact@master
with:
name: ${{ env.DISTPATH }}
path: ${{ env.DISTPATH }}

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
- name: Init git
run: |
git config --local user.name "Github BUILD"
git config user.email github-actions@github.com
git add ./esptool/targets/stub_flasher/*
git diff --cached >> diff
echo $diff
echo "dif=$diff" >> $GITHUB_ENV
echo ${{ env.dif }}
- name: Check for changes in stub files
if: contains(${{ env.dif }}, 'json') == true
run: git commit --allow-empty -m "stubs updated"
- name: Get branch
uses: jason2866/branch-name@master
- run: echo "brnch=${BRANCH_NAME}" >> $GITHUB_ENV
- name: Push to current branch
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ env.brnch }}

create_release:
name: Create GitHub release
if: startsWith(github.ref, 'refs/tags/')
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/issue_comment.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/new_issues.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/new_prs.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/release_esptool_pypi.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/test_esptool.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
espefuse.py --help
espsecure.py --help

- name: Build stub (Python 3.7 only)
if: matrix.python-version == 3.7
- name: Build stub (Python 3.8 only)
if: matrix.python-version == 3.8
run: |
export TOOLCHAIN_DIR=$HOME/toolchain

Expand Down
5 changes: 3 additions & 2 deletions esptool/targets/esp32.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@ def get_chip_description(self):

chip_name = {
0: "ESP32-S0WDQ6" if single_core else "ESP32-D0WDQ6",
1: "ESP32-S0WD" if single_core else "ESP32-D0WD",
2: "ESP32-D2WD",
1: "ESP32-S0WDQ5" if single_core else "ESP32-D0WDQ5",
2: "ESP32-S2WDQ5" if single_core else "ESP32-D2WDQ5",
3: "ESP32-S0WD-OEM" if single_core else "ESP32-D0WD-OEM",
4: "ESP32-U4WDH",
5: "ESP32-PICO-V3" if rev3 else "ESP32-PICO-D4",
6: "ESP32-PICO-V3-02",
Expand Down
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "tool-esptoolpy",
"version": "1.40401",
"description": "Espressif ESP8266 and ESP32 serial bootloader utility",
"keywords": [
"tools",
"uploader",
"espressif"
],
"license": "GPL-2.0-or-later",
"repository": {
"type": "git",
"url": "https://github.com/tasmota/esptool"
}
}