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 7c6906d commit 2ca7265
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/actions/build-python-from-source/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,19 @@ runs:
git checkout ${{ inputs.python-version }}
fi
- name: Cache Python built artifacts
uses: actions/cache@v3
id: python-cache
with:
path: |
/usr/local/python-${{ inputs.python-version }} (Linux)
${github.workspace}/Python/${{ inputs.python-version }} (Windows)
/usr/local/python-${{ inputs.python-version }} (macOS)
key: ${{ runner.os }}-python-${{ inputs.python-version }}-${{ inputs.nogil }}

# Configure and build Python based on the OS and the 'nogil' input.
- name: Configure and build Python
if: steps.python-cache.outputs.cache-hit != 'true'
shell: bash
run: |
# Do some output to help debugging if things go wrong/
Expand Down Expand Up @@ -81,6 +92,7 @@ runs:
# Install the built Python version.
- name: Install Python
if: steps.python-cache.outputs.cache-hit != 'true'
shell: bash
run: |
cd cpython
Expand All @@ -104,6 +116,7 @@ runs:
echo "LOCAL_PYTHON=/usr/local/python-${{ inputs.python-version }}/bin/python3" >> $GITHUB_ENV
else
# Find the Python executable and set LOCAL_PYTHON
cd cpython
cwd=$(pwd)
LOCAL_PYTHON=$(find "${cwd}/Python/${{ inputs.python-version }}" -name "python3*_d.exe")
echo "LOCAL_PYTHON=${LOCAL_PYTHON}" >> $GITHUB_ENV
Expand Down

0 comments on commit 2ca7265

Please sign in to comment.