Skip to content

Commit c042f01

Browse files
committed
Try with multiple files
1 parent 44b0229 commit c042f01

File tree

3 files changed

+46
-26
lines changed

3 files changed

+46
-26
lines changed

.github/workflows/build_py_tools.yml

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
pull_request:
55
paths:
66
- 'tools/get.py'
7+
- 'tools/espota.py'
8+
- 'tools/gen_esp32part.py'
9+
- 'tools/gen_insights_package.py'
710

811
jobs:
912
find-changed-tools:
@@ -26,6 +29,9 @@ jobs:
2629
since_last_remote_commit: 'true'
2730
files: |
2831
tools/get.py
32+
tools/espota.py
33+
tools/gen_esp32part.py
34+
tools/gen_insights_package.py
2935
- name: List all changed files
3036
shell: bash
3137
run: |
@@ -69,8 +75,17 @@ jobs:
6975
- name: List all changed files
7076
shell: bash
7177
run: |
78+
CHANGED_FILES=()
7279
for file in ${{ needs.find-changed-tools.outputs.all_changed_files }}; do
73-
echo "$file was changed"
80+
echo "$file got changed"
81+
file="${file#*\/}"
82+
file="${file%\.*}"
83+
CHANGED_FILES+=("$file")
84+
done
85+
CHANGED_FILES="${CHANGED_FILES[@]}"
86+
echo "CHANGED_TOOLS=$CHANGED_FILES" >> "$GITHUB_ENV"
87+
for tool in ${{ env.CHANGED_TOOLS }}; do
88+
echo "tool $tool was changed"
7489
done
7590
- name: Checkout repository
7691
uses: actions/checkout@v3
@@ -87,30 +102,33 @@ jobs:
87102
python -m pip install --upgrade pip
88103
pip install pyinstaller requests
89104
- name: Build with PyInstaller
90-
run: |
91-
pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=.github/pytools/espressif.ico tools/get.py
92-
- name: Sign binaries
93-
if: matrix.os == 'windows-latest'
94-
env:
95-
CERTIFICATE: ${{ secrets.CERTIFICATE }}
96-
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
97-
shell: pwsh
98-
run: |
99-
./.github/pytools/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/get.exe
100-
- name: Test binaries
101105
shell: bash
102106
run: |
103-
./${{ env.DISTPATH }}/get${{ matrix.EXTEN }} -h
104-
# Commit and push changed files.
105-
- name: Push binary to tools
106-
if: matrix.os == 'windows-latest'
107-
env:
108-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
109-
run: |
110-
cp -Force ./${{ env.DISTPATH }}/get.exe tools/get.exe
111-
bash .github/scripts/upload_py_tools.sh
112-
- name: Archive artifact
113-
uses: actions/upload-artifact@master
114-
with:
115-
name: ${{ env.DISTPATH }}
116-
path: ${{ env.DISTPATH }}
107+
for tool in ${{ env.CHANGED_TOOLS }}; do
108+
echo "pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=.github/pytools/espressif.ico tools/$tool.py"
109+
done
110+
# pyinstaller --distpath ./${{ env.DISTPATH }} -F --icon=.github/pytools/espressif.ico tools/get.py
111+
# - name: Sign binaries
112+
# if: matrix.os == 'windows-latest'
113+
# env:
114+
# CERTIFICATE: ${{ secrets.CERTIFICATE }}
115+
# CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
116+
# shell: pwsh
117+
# run: |
118+
# if exist ./${{ env.DISTPATH }}/get.exe ./.github/pytools/Sign-File.ps1 -Path ./${{ env.DISTPATH }}/get.exe
119+
# - name: Test binaries
120+
# shell: bash
121+
# run: |
122+
# ./${{ env.DISTPATH }}/get${{ matrix.EXTEN }} -h
123+
# - name: Push binary to tools
124+
# if: matrix.os == 'windows-latest'
125+
# env:
126+
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
127+
# run: |
128+
# cp -Force ./${{ env.DISTPATH }}/get.exe tools/get.exe
129+
# bash .github/scripts/upload_py_tools.sh
130+
# - name: Archive artifact
131+
# uses: actions/upload-artifact@master
132+
# with:
133+
# name: ${{ env.DISTPATH }}
134+
# path: ${{ env.DISTPATH }}

tools/espota.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,3 +351,4 @@ def main(args):
351351

352352
if __name__ == '__main__':
353353
sys.exit(main(sys.argv))
354+

tools/get.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,4 @@ def identify_platform():
238238
else:
239239
get_tool(tool)
240240
print('Platform Tools Installed')
241+

0 commit comments

Comments
 (0)