Skip to content

Commit

Permalink
Update build-windows.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
shdwmtr committed Jun 12, 2024
1 parent adeaa5b commit 5a10902
Showing 1 changed file with 9 additions and 26 deletions.
35 changes: 9 additions & 26 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ jobs:

- name: Set up cache for Python source
uses: actions/cache@v3
id: python-cache
id: build-cache
with:
path: Python-3.11.8
key: ${{ runner.os }}-python-3.11.8-source-${{ hashFiles('.github/workflows/build-windows.yml') }}
path: |
Python-3.11.8/PCbuild/win32
key: ${{ runner.os }}-python-3.11.8-build-${{ hashFiles('.github/workflows/build-windows.yml') }}
restore-keys: |
${{ runner.os }}-python-3.11.8-source-
${{ runner.os }}-python-3.11.8-build-
- name: (Python) Download 3.11.8 win32 source
if: steps.python-cache.outputs.cache-hit != 'true'
if: steps.build-cache.outputs.cache-hit != 'true'
run: |
# download python 3.11.8 source code
Expand All @@ -53,17 +54,13 @@ jobs:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"

- name: (Python) Stage Python 3.11.8 static build
if: steps.python-cache.outputs.cache-hit != 'true'
if: steps.build-cache.outputs.cache-hit != 'true'
run: |
cd Python-3.11.8
$vcxprojPath = "PCbuild/pythoncore.vcxproj"
$content = Get-Content $vcxprojPath -Raw # Read the entire content as a single string
Write-Output "Original Content:"
Write-Output $content
$pattern = '</ClCompile>'
$replacement = @"
<RuntimeLibrary Condition="'`$(Configuration)|`$(Platform)'=='Release|Win32'">MultiThreaded</RuntimeLibrary>
Expand All @@ -72,15 +69,12 @@ jobs:
"@
$modifiedContent = $content -replace [regex]::Escape($pattern), $replacement
Write-Output "`nModified Content:"
Write-Output $modifiedContent
$modifiedContent | Set-Content $vcxprojPath
shell: pwsh

- name: (Python) Build 3.11.8
if: steps.python-cache.outputs.cache-hit != 'true'
if: steps.build-cache.outputs.cache-hit != 'true'
run: |
cd Python-3.11.8
Expand All @@ -91,17 +85,6 @@ jobs:
# verify python is installed
PCbuild\win32\python.exe --version
- name: Set up cache for build files
uses: actions/cache@v3
id: build-cache
with:
path: |
Python-3.11.8/PCbuild/amd64
Python-3.11.8/PCbuild/win32
key: ${{ runner.os }}-python-3.11.8-build-${{ hashFiles('.github/workflows/build-windows.yml') }}
restore-keys: |
${{ runner.os }}-python-3.11.8-build-
- name: (Generator) Integrate VS2022
uses: microsoft/setup-msbuild@v2
with:
Expand Down

0 comments on commit 5a10902

Please sign in to comment.