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 3653c83 commit d91a68d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
24 changes: 15 additions & 9 deletions .github/actions/build-python-from-source/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ runs:
elif [ "${{ runner.os }}" = "Windows" ]; then
prefix="C:/Python/${{ inputs.python-version }}"
fi
#if [ "${{ runner.os }}" = "macOS" ]; then
# configure_options+=" --enable-shared"
#fi
# Build it!
if [ "${{ runner.os }}" != "Windows" ]; then
./configure --prefix=$prefix CFLAGS="-O3" CXXFLAGS="-O3" $configure_options
Expand All @@ -80,8 +77,16 @@ runs:
set CXXFLAGS=/Ox
./PCbuild/build.bat -e -d $configure_options
fi
# Make sure we use our version of python.
echo "LOCAL_PYTHON=$prefix/bin/python3" >> $GITHUB_ENV
# Make sure we use our version of python.
- name: Set LOCAL_PYTHON
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
Expand All @@ -91,12 +96,13 @@ runs:
if [ "${{ runner.os }}" != "Windows" ]; then
sudo make install
else
# Get the current working directory
cwd=$(pwd)
# Create the installation directory
mkdir "C:/Python/${{ inputs.python-version }}"
mkdir -p "${cwd}/Python/${{ inputs.python-version }}"
# Copy the Python executable and necessary DLLs to the installation directory
cp PCbuild/amd64/python.exe "C:/Python/${{ inputs.python-version }}"
cp PCbuild/amd64/*.dll "C:/Python/${{ inputs.python-version }}"
cp PCbuild/amd64/python.exe "${cwd}/Python/${{ inputs.python-version }}"
cp PCbuild/amd64/*.dll "${cwd}/Python/${{ inputs.python-version }}"
fi
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ jobs:
# python-version: 'v3.13.0'
# build-from-source: true
# nogil: true
#- os: windows-latest
# python-version: 'v3.13.0'
# build-from-source: true
# nogil: true
- os: macos-latest
- os: windows-latest
python-version: 'v3.13.0'
build-from-source: true
nogil: true
#- os: macos-latest
# python-version: 'v3.13.0'
# build-from-source: true
# nogil: true
#- os: ubuntu-latest
# python-version: '3.14.0-alpha.0'
# build-from-source: true
Expand Down

0 comments on commit d91a68d

Please sign in to comment.