Skip to content

Commit

Permalink
Add python source build
Browse files Browse the repository at this point in the history
  • Loading branch information
SonicField committed Oct 15, 2024
1 parent 313966b commit 9b48c54
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions .github/actions/build-python-from-source/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ runs:
if [ "${{ runner.os }}" = "Linux" ] || [ "${{ runner.os }}" = "macOS" ]; then
prefix="/usr/local/python-${{ inputs.python-version }}"
elif [ "${{ runner.os }}" = "Windows" ]; then
prefix="C:/Python/${{ inputs.python-version }}"
cwd=$(pwd)
prefix=$(cygpath -w "${cwd}/Python/${{ inputs.python-version }}")
fi
# Build it!
if [ "${{ runner.os }}" != "Windows" ]; then
Expand All @@ -78,17 +79,6 @@ runs:
./PCbuild/build.bat -e -d $configure_options
fi
# Make sure we use our version of python.
- name: Set LOCAL_PYTHON
shell: bash
run: |
if [ "${{ runner.os }}" != "Windows" ]; then
echo "LOCAL_PYTHON=/usr/local/python-${{ inputs.python-version }}/bin/python3" >> $GITHUB_ENV
else
cwd=$(pwd)
echo "LOCAL_PYTHON=${cwd}/Python/${{ inputs.python-version }}/python.exe" >> $GITHUB_ENV
fi
# Install the built Python version.
- name: Install Python
shell: bash
Expand All @@ -102,10 +92,20 @@ runs:
# Create the installation directory
mkdir -p "${cwd}/Python/${{ inputs.python-version }}"
# Copy the Python executable and necessary DLLs to the installation directory
cp PCbuild/amd64/python.exe "${cwd}/Python/${{ inputs.python-version }}"
cp PCbuild/amd64/*.exe "${cwd}/Python/${{ inputs.python-version }}"
cp PCbuild/amd64/*.dll "${cwd}/Python/${{ inputs.python-version }}"
fi
# Make sure we use our version of python.
- name: Set LOCAL_PYTHON
shell: bash
run: |
if [ "${{ runner.os }}" != "Windows" ]; then
echo "LOCAL_PYTHON=/usr/local/python-${{ inputs.python-version }}/bin/python3" >> $GITHUB_ENV
else
cwd=$(pwd)
echo "LOCAL_PYTHON=${cwd}/Python/${{ inputs.python-version }}/python3*_d.exe" >> $GITHUB_ENV
fi
# Ensure python is in the path and log out the version to help with debug.
- name: Verify Python Installation
Expand Down

0 comments on commit 9b48c54

Please sign in to comment.