Skip to content

Commit 6fa3d3b

Browse files
authored
pioarduino changes
1 parent a6bceb7 commit 6fa3d3b

21 files changed

+1859
-258
lines changed

.github/workflows/build_esptool.yml

Lines changed: 83 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Build esptool
22

3-
on: [push, pull_request]
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v*.*.*"
8+
paths-ignore:
9+
- '.github/**' # Ignore changes towards the .github directory
410

511
jobs:
612
build-esptool-binaries-arm:
@@ -16,7 +22,7 @@ jobs:
1622
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi"
1723
steps:
1824
- name: Checkout repository
19-
uses: actions/checkout@master
25+
uses: actions/checkout@v4
2026
- uses: uraimo/run-on-arch-action@v2
2127
name: Build and test in ${{ matrix.platform }}
2228
with:
@@ -55,11 +61,8 @@ jobs:
5561
./${{ env.DISTPATH }}/espsecure -h || exit 1
5662
./${{ env.DISTPATH }}/esp_rfc2217_server -h || exit 1
5763
58-
# Add license and readme
59-
mv LICENSE README.md ./${{ env.DISTPATH }}
60-
6164
- name: Archive artifact
62-
uses: actions/upload-artifact@master
65+
uses: actions/upload-artifact@v4
6366
with:
6467
name: ${{ env.DISTPATH }}
6568
path: ${{ env.DISTPATH }}
@@ -95,98 +98,104 @@ jobs:
9598
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi"
9699
steps:
97100
- name: Checkout repository
98-
uses: actions/checkout@master
99-
- name: Set up Python 3.8
100-
uses: actions/setup-python@master
101+
uses: actions/checkout@v4
102+
- name: Set up Python 3.11
103+
uses: actions/setup-python@v5
101104
with:
102-
python-version: 3.8
105+
python-version: 3.11
106+
- name: Update esptool version when releasing
107+
if: startsWith(github.ref, 'refs/tags/')
108+
run: |
109+
python ci/patch_release.py --version ${{ github.ref_name }} esptool/__init__.py
110+
#git diff
103111
- name: Install dependencies
104-
# PyInstaller >=6.0 results in significantly more antivirus false positives
105112
run: |
106113
python -m pip install --upgrade pip
107-
pip install pyinstaller==5.13.2
114+
pip install pyinstaller==6.11.1
108115
pip install --user -e .
109116
- name: Build with PyInstaller
110117
run: |
111118
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
112119
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico --add-data="${{ env.EFUSE_DIR }}*.yaml${{ matrix.SEPARATOR }}${{ env.EFUSE_DIR }}" espefuse.py
113120
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico espsecure.py
114121
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=ci/espressif.ico esp_rfc2217_server.py
115-
- name: Sign binaries
116-
if: matrix.platform == 'windows' && github.event_name != 'pull_request'
117-
env:
118-
CERTIFICATE: ${{ secrets.CERTIFICATE }}
119-
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
120-
shell: pwsh
121-
run: |
122-
./ci/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/esptool.exe
123-
./ci/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/espefuse.exe
124-
./ci/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/espsecure.exe
125-
./ci/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/esp_rfc2217_server.exe
126122
- name: Test binaries
127123
shell: bash
128124
run: |
129125
./${{ env.DISTPATH }}/esptool${{ matrix.EXTEN }} -h
130126
./${{ env.DISTPATH }}/espefuse${{ matrix.EXTEN }} -h
131127
./${{ env.DISTPATH }}/espsecure${{ matrix.EXTEN }} -h
132128
./${{ env.DISTPATH }}/esp_rfc2217_server${{ matrix.EXTEN }} -h
133-
- name: Add license and readme
134-
shell: bash
135-
run: mv LICENSE README.md ./${{ env.DISTPATH }}
136129
- name: Archive artifact
137-
uses: actions/upload-artifact@master
130+
uses: actions/upload-artifact@v4
138131
with:
139132
name: ${{ env.DISTPATH }}
140133
path: ${{ env.DISTPATH }}
134+
- name: Update package.json when a release tag is set
135+
if: startsWith(github.ref, 'refs/tags/') && matrix.platform == 'linux-amd64'
136+
run: |
137+
rm -f package.json
138+
python ci/gen_pio_manifest.py -o "./" -s ${{ github.ref_name }}
139+
- name: Upload package.json artifact
140+
if: startsWith(github.ref, 'refs/tags/') && matrix.platform == 'linux-amd64'
141+
uses: actions/upload-artifact@v4
142+
with:
143+
name: manifest
144+
path: /home/runner/work/esptool/esptool/package.json
141145

142-
create_release:
143-
name: Create GitHub release
144-
if: startsWith(github.ref, 'refs/tags/') && !(contains(github.ref_name, 'dev'))
145-
needs: [build-esptool-binaries, build-esptool-binaries-arm]
146+
push_stubs:
147+
name: Commit changed package.json
148+
needs: build-esptool-binaries
146149
runs-on: ubuntu-latest
147-
env:
148-
PIP_EXTRA_INDEX_URL: "https://dl.espressif.com/pypi"
149-
permissions:
150-
contents: write
151150
steps:
152-
- name: Get version
153-
id: get_version
154-
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
155-
shell: bash
156-
- name: Checkout
157-
uses: actions/checkout@master
151+
- name: Checkout repository
152+
uses: actions/checkout@v4
158153
with:
159-
fetch-depth: 0
160-
- name: Install dependencies
161-
run: |
162-
python -m pip install --upgrade pip
163-
pip install --user -e ".[dev]"
164-
- name: Generate changelog
165-
run: |
166-
cz changelog ${{ steps.get_version.outputs.VERSION }} --template ci/gh_changelog_template.md.j2 --file-name changelog_body.md
167-
cat changelog_body.md
168-
- name: Download built binaries
169-
uses: actions/download-artifact@master
170-
- name: Compress and rename binaries
171-
run: |
172-
for dir in esptool-*; do
173-
if [[ "$dir" == esptool-win* ]]; then
174-
zip -r "esptool-v${{ steps.get_version.outputs.VERSION }}-${dir#esptool-}.zip" "$dir"
175-
else
176-
chmod -R u=rwx,g=rx,o=rx "$dir"
177-
tar -cvzf "esptool-v${{ steps.get_version.outputs.VERSION }}-${dir#esptool-}.tar.gz" "$dir"
178-
fi
179-
done
180-
- name: Create release
181-
id: create_release
182-
uses: softprops/action-gh-release@v1
183-
env:
184-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
154+
ref: main
155+
if: startsWith(github.ref, 'refs/tags/')
156+
- name: Download artifacts
157+
uses: actions/download-artifact@v4
158+
if: startsWith(github.ref, 'refs/tags/')
185159
with:
186-
body_path: changelog_body.md
187-
name: Version ${{ steps.get_version.outputs.VERSION }}
188-
draft: true
189-
prerelease: false
190-
files: |
191-
esptool-v${{ steps.get_version.outputs.VERSION }}-*.zip
192-
esptool-v${{ steps.get_version.outputs.VERSION }}-*.tar.gz
160+
name: |
161+
manifest
162+
path: |
163+
./
164+
- uses: stefanzweifel/git-auto-commit-action@v5
165+
if: startsWith(github.ref, 'refs/tags/')
166+
with:
167+
commit_message: update manifest
168+
169+
release:
170+
name: Upload release binaries
171+
needs: [build-esptool-binaries, build-esptool-binaries-arm, push_stubs]
172+
if: startsWith(github.ref, 'refs/tags/')
173+
runs-on: ubuntu-latest
174+
steps:
175+
- name: Checkout repository
176+
uses: actions/checkout@v4
177+
- name: Zip esptool.py
178+
run: |
179+
echo "Packaging new esptool release: ${{ github.ref_name }}"
180+
python ci/patch_release.py --version ${{ github.ref_name }} esptool/__init__.py
181+
rm package.json
182+
python ci/gen_pio_manifest.py -o "./" -s ${{ github.ref_name }}
183+
python ci/pack_python.py
184+
- name: Download built binaries
185+
uses: actions/download-artifact@v4
186+
- name: Rename and package binaries
187+
run: |
188+
zip -r esptool-armv7.zip ./esptool-armv7
189+
zip -r esptool-aarch64.zip ./esptool-aarch64
190+
zip -r esptool-macos-arm64.zip ./esptool-macos-arm64
191+
zip -r esptool-macos-amd64.zip ./esptool-macos-amd64
192+
zip -r esptool-linux-amd64.zip ./esptool-linux-amd64
193+
zip -r esptool-win64.zip ./esptool-win64
194+
- name: Release
195+
uses: jason2866/action-gh-release@v1.3
196+
with:
197+
prerelease: false
198+
files: |
199+
*.zip
200+
env:
201+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/dangerjs.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/dev_release_esptool_pypi.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/issue_comment.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/new_issues.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/new_prs.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/release_esptool_pypi.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)