From e9587918714a9de1e67fd7b1f4065f64d4310153 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Wed, 28 Dec 2022 16:40:49 +0100 Subject: [PATCH 1/3] Tasmota (#5) * Tasmota changes * stubs updated * S3 16MB fix (#4) * fix(setup): Use latest reedsolo package which can be installed with Python3.10 and Cython Closes https://github.com/espressif/esptool/issues/711 * feat(ci): Publish development releases with custom pipeline * fix(ci): The development release job should not run by default Gitlab rules:if adds the job if any of the rules are true. * fix(ci): Merge two "ci" directories and build_tools into one * fix(secure download mode): Fix SDM detection on S2/S3 * fix(secure download mode): Reconnect if ROM refuses to respond Closes https://github.com/espressif/esptool/issues/813 * fix(flasher_stub): Correct boundaries for SPIWrite4B and SPIRead4B SPIWrite4B and SPIRead4B functions are required for flash sizes bigger than 16MB. This fix corrects the boundaries so SPIWrite and SPIRead would be used for the whole 16MB area. The octal flash support for 32 MB chips (https://github.com/espressif/esptool/issues/795) will be added in a follow-up commit. Closes https://github.com/espressif/esptool/issues/745 Co-authored-by: Roland Dobai Co-authored-by: radim.karnis * Update stub_flasher_32s3beta2.json * Update build_esptool.yml * Update build_esptool.yml * stubs updated Co-authored-by: Github BUILD Co-authored-by: Roland Dobai Co-authored-by: radim.karnis --- .github/workflows/build_esptool.yml | 84 ++++++++++++++++++---- .github/workflows/issue_comment.yml | 20 ------ .github/workflows/new_issues.yml | 20 ------ .github/workflows/new_prs.yml | 25 ------- .github/workflows/release_esptool_pypi.yml | 40 ----------- .github/workflows/test_esptool.yml | 4 +- esptool/targets/esp32.py | 5 +- package.json | 15 ++++ 8 files changed, 89 insertions(+), 124 deletions(-) delete mode 100644 .github/workflows/issue_comment.yml delete mode 100644 .github/workflows/new_issues.yml delete mode 100644 .github/workflows/new_prs.yml delete mode 100644 .github/workflows/release_esptool_pypi.yml create mode 100644 package.json diff --git a/.github/workflows/build_esptool.yml b/.github/workflows/build_esptool.yml index 380732915..7122c922f 100644 --- a/.github/workflows/build_esptool.yml +++ b/.github/workflows/build_esptool.yml @@ -1,6 +1,10 @@ name: Build esptool -on: [push, pull_request] +on: + workflow_dispatch: + push: + paths-ignore: + - '.github/**' # Ignore changes towards the .github directory jobs: build-esptool-binaries: @@ -8,9 +12,9 @@ jobs: 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 @@ -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: | @@ -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/') diff --git a/.github/workflows/issue_comment.yml b/.github/workflows/issue_comment.yml deleted file mode 100644 index 5a42897b4..000000000 --- a/.github/workflows/issue_comment.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Sync issue comments to JIRA - -# This workflow will be triggered when new issue comment is created (including PR comments) -on: issue_comment - -jobs: - sync_issue_comments_to_jira: - name: Sync Issue Comments to Jira - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: Sync issue comments to JIRA - uses: espressif/github-actions/sync_issues_to_jira@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JIRA_PASS: ${{ secrets.JIRA_PASS }} - JIRA_PROJECT: ESPTOOL - JIRA_COMPONENT: GitHub - JIRA_URL: ${{ secrets.JIRA_URL }} - JIRA_USER: ${{ secrets.JIRA_USER }} diff --git a/.github/workflows/new_issues.yml b/.github/workflows/new_issues.yml deleted file mode 100644 index f79bdcae6..000000000 --- a/.github/workflows/new_issues.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Sync issues to Jira - -# This workflow will be triggered when a new issue is opened -on: issues - -jobs: - sync_issues_to_jira: - name: Sync issues to Jira - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: Sync GitHub issues to Jira project - uses: espressif/github-actions/sync_issues_to_jira@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JIRA_PASS: ${{ secrets.JIRA_PASS }} - JIRA_PROJECT: ESPTOOL - JIRA_COMPONENT: GitHub - JIRA_URL: ${{ secrets.JIRA_URL }} - JIRA_USER: ${{ secrets.JIRA_USER }} diff --git a/.github/workflows/new_prs.yml b/.github/workflows/new_prs.yml deleted file mode 100644 index 05a56b2f5..000000000 --- a/.github/workflows/new_prs.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Sync remaining PRs to Jira - -# This workflow will be triggered every hour, to sync remaining PRs (i.e. PRs with zero comment) to Jira project -# Note that, PRs can also get synced when new PR comment is created -on: - schedule: - - cron: "0 * * * *" - -jobs: - sync_prs_to_jira: - name: Sync PRs to Jira - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - name: Sync PRs to Jira project - uses: espressif/github-actions/sync_issues_to_jira@master - with: - cron_job: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - JIRA_PASS: ${{ secrets.JIRA_PASS }} - JIRA_PROJECT: ESPTOOL - JIRA_COMPONENT: GitHub - JIRA_URL: ${{ secrets.JIRA_URL }} - JIRA_USER: ${{ secrets.JIRA_USER }} diff --git a/.github/workflows/release_esptool_pypi.yml b/.github/workflows/release_esptool_pypi.yml deleted file mode 100644 index cd0c01bb0..000000000 --- a/.github/workflows/release_esptool_pypi.yml +++ /dev/null @@ -1,40 +0,0 @@ -# This workflow will upload an esptool Python package when a release is created - -name: PyPI release - -on: - release: - types: [released] - -jobs: - build_and_upload: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@master - - name: Set up Python 3.7 - uses: actions/setup-python@master - with: - python-version: '3.7' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools twine - - name: Build and upload esptool ${{ github.event.release.tag_name }} - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - PUBLISHED_VERSION=$(curl https://pypi.org/pypi/esptool/json 2>/dev/null | jq -r '.info.version') - CURRENT_VERSION=$(python setup.py --version 2>/dev/null) - - if [ "$PUBLISHED_VERSION" == "$CURRENT_VERSION" ]; then - echo "Version ${PUBLISHED_VERSION} already published, skipping..." - exit 1 - else - echo "Packaging and publishing new esptool version: ${CURRENT_VERSION}" - python setup.py sdist - tar -ztvf dist/* - twine upload dist/* - fi diff --git a/.github/workflows/test_esptool.yml b/.github/workflows/test_esptool.yml index 5baaa3c5f..6c3e03bf8 100644 --- a/.github/workflows/test_esptool.yml +++ b/.github/workflows/test_esptool.yml @@ -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 diff --git a/esptool/targets/esp32.py b/esptool/targets/esp32.py index d6c019918..87f399d22 100644 --- a/esptool/targets/esp32.py +++ b/esptool/targets/esp32.py @@ -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", diff --git a/package.json b/package.json new file mode 100644 index 000000000..b905f4c9b --- /dev/null +++ b/package.json @@ -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" + } +} From 1bbb4993b146da2d19944135a74137705d33e47c Mon Sep 17 00:00:00 2001 From: Github BUILD Date: Wed, 28 Dec 2022 15:43:52 +0000 Subject: [PATCH 2/3] stubs updated From 43280146fa373d7226deee387c32f5be7edad76b Mon Sep 17 00:00:00 2001 From: Github BUILD Date: Wed, 28 Dec 2022 15:48:18 +0000 Subject: [PATCH 3/3] stubs updated