@@ -43,14 +43,14 @@ inputs:
4343 required : false
4444 default : ' '
4545 pip-extra-index-url :
46- description : Extra pip index URL
46+ description : Extra Python Package Index URL
4747 required : false
4848 default : https://dl.espressif.com/pypi
4949 install-deps-command :
5050 description : Command to install project dependencies. Command will be executed
51- like `python -m {install-deps-command}`
51+ like `uv pip install {install-deps-command}`
5252 required : false
53- default : pip install --user --prefer-binary -e .
53+ default : uv pip install -e .
5454 additional-arm-packages :
5555 description : ' ARMv7 ONLY: Additional system packages to install (space-separated).
5656 e.g. for cryptography: openssl libffi-dev libffi7 libssl-dev'
@@ -134,23 +134,27 @@ runs:
134134 --volume "${PWD}/${{ inputs.output-dir }}:/${{ inputs.output-dir }}"
135135 --volume "${GITHUB_ACTION_PATH}:/github/action"
136136 install : |
137+ export DEBIAN_FRONTEND=noninteractive
138+ export TZ=UTC
137139 apt-get update -y
138- apt-get install -y software-properties-common
139- add-apt-repository -y ppa:deadsnakes/ppa
140- apt-get update -y
141- apt-get install --ignore-missing -y curl python${{ inputs.python-version }} python${{ inputs.python-version }}-dev pkg-config gcc g++ patchelf binutils zlib1g-dev ${{ inputs.additional-arm-packages }}
142- # Install pip for requested Python version using get-pip.py as ensurepip does not work here
143- curl -sS https://bootstrap.pypa.io/get-pip.py | python${{ inputs.python-version }}
144- python${{ inputs.python-version }} -m pip install --upgrade pip setuptools wheel
140+ apt-get install -y curl git build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev pkg-config gcc g++ patchelf binutils ${{ inputs.additional-arm-packages }}
145141 run : |
146142 adduser --disabled-password --gecos "" builder
147143 chmod -R a+rwx /home/runner/work
148144 su builder <<'EOF'
145+ curl -LsSf https://astral.sh/uv/install.sh | sh
146+ source $HOME/.local/bin/env
147+ # Install Python version using uv
148+ uv python install ${{ inputs.python-version }}
149+ # Create and activate virtual environment
150+ uv venv
151+ source .venv/bin/activate
152+ # Install UV and upgrade tools
153+ uv pip install --upgrade setuptools wheel
149154 export PATH=$PATH:/home/builder/.local/bin
150155
151156 # Setup environment using helper script
152157 /github/action/setup_environment.sh \
153- "python${{ inputs.python-version }}" \
154158 "${{ inputs.pyinstaller-version }}" \
155159 "${{ inputs.pip-extra-index-url }}" \
156160 "${{ inputs.install-deps-command }}"
@@ -161,7 +165,6 @@ runs:
161165 # Build each file using the script
162166 export GITHUB_ACTION_PATH=/github/action
163167 /github/action/build_with_pyinstaller.sh \
164- "python${{ inputs.python-version }}" \
165168 "${{ inputs.target-platform }}" \
166169 "${{ inputs.output-dir }}" \
167170 "${{ inputs.scripts }}" \
@@ -192,32 +195,51 @@ runs:
192195 -w ${GITHUB_WORKSPACE} \
193196 ubuntu:20.04 \
194197 bash -c "
198+ export DEBIAN_FRONTEND=noninteractive &&
199+ export TZ=UTC &&
195200 apt-get update -y &&
196- apt-get install -y software-properties-common curl &&
197- add-apt-repository -y ppa:deadsnakes/ppa &&
198- apt-get update -y &&
199- apt-get install -y python${{ inputs.python-version }} python${{ inputs.python-version }}-dev pkg-config gcc g++ patchelf binutils zlib1g-dev &&
200- curl -sS https://bootstrap.pypa.io/get-pip.py | python${{ inputs.python-version }} &&
201- python${{ inputs.python-version }} -m pip install --upgrade pip setuptools wheel &&
201+ apt-get install -y curl git build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev pkg-config gcc g++ patchelf binutils &&
202+ curl -LsSf https://astral.sh/uv/install.sh | sh &&
203+ source /root/.local/bin/env &&
204+ # Install Python version using uv
205+ uv python install ${{ inputs.python-version }} &&
206+ # Create and activate virtual environment
207+ uv venv &&
208+ source .venv/bin/activate &&
209+ # Install UV and upgrade tools
210+ uv pip install --upgrade setuptools wheel &&
202211
203212 export GITHUB_ACTION_PATH=/github/action &&
204213 /github/action/setup_environment.sh \
205- 'python${{ inputs.python-version }}' \
206214 '${{ inputs.pyinstaller-version }}' \
207215 '${{ inputs.pip-extra-index-url }}' \
208216 '${{ inputs.install-deps-command }}' &&
209217
210218 # Execute the build script
211- /github/action/build_with_pyinstaller.sh 'python${{ inputs.python-version }}' ' ${{ inputs.target-platform }}' '${{ inputs.output-dir }}' '${{ inputs.scripts }}' '${{ inputs.script-name }}' '${{ inputs.icon-file }}' '/github/action/include_data_dirs.json' '${{ steps.setup-platform.outputs.data-separator }}' '${{ inputs.additional-args }}'
219+ /github/action/build_with_pyinstaller.sh '${{ inputs.target-platform }}' '${{ inputs.output-dir }}' '${{ inputs.scripts }}' '${{ inputs.script-name }}' '${{ inputs.icon-file }}' '/github/action/include_data_dirs.json' '${{ steps.setup-platform.outputs.data-separator }}' '${{ inputs.additional-args }}'
212220 "
213221
222+ - name : Install UV
223+ if : |
224+ steps.setup-platform.outputs.needs-docker == 'false' && steps.setup-platform.outputs.needs-arm-emulation == 'false'
225+ uses : astral-sh/setup-uv@v6
226+ with :
227+ enable-cache : true
228+
214229 - name : Setup environment (Native platforms)
215230 if : |
216231 steps.setup-platform.outputs.needs-docker == 'false' && steps.setup-platform.outputs.needs-arm-emulation == 'false'
217232 shell : bash
218233 run : |
234+ # Create and activate virtual environment
235+ uv venv
236+ if [ "${{ inputs.target-platform }}" == 'windows-amd64' ]; then
237+ source .venv\\Scripts\\activate
238+ else
239+ source .venv/bin/activate
240+ fi
241+
219242 $GITHUB_ACTION_PATH/setup_environment.sh \
220- 'python' \
221243 '${{ inputs.pyinstaller-version }}' \
222244 '${{ inputs.pip-extra-index-url }}' \
223245 '${{ inputs.install-deps-command }}'
@@ -228,7 +250,7 @@ runs:
228250 id : build
229251 shell : bash
230252 run : |
231- $GITHUB_ACTION_PATH/build_with_pyinstaller.sh 'python' ' ${{ inputs.target-platform }}' '${{ inputs.output-dir }}' '${{ inputs.scripts }}' '${{ inputs.script-name }}' '${{ inputs.icon-file }}' '${{ inputs.include-data-dirs }}' '${{ steps.setup-platform.outputs.data-separator }}' '${{ inputs.additional-args }}'
253+ $GITHUB_ACTION_PATH/build_with_pyinstaller.sh '${{ inputs.target-platform }}' '${{ inputs.output-dir }}' '${{ inputs.scripts }}' '${{ inputs.script-name }}' '${{ inputs.icon-file }}' '${{ inputs.include-data-dirs }}' '${{ steps.setup-platform.outputs.data-separator }}' '${{ inputs.additional-args }}'
232254
233255 echo "success=true" >> $GITHUB_OUTPUT
234256
0 commit comments