Skip to content

Commit 602d865

Browse files
committed
Add workflows/build-python-dev
1 parent c14d34d commit 602d865

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build Python dev files for Windows
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- python_dev
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build:
14+
runs-on: windows-latest
15+
16+
strategy:
17+
matrix:
18+
python-version: [3.10.11, 3.12.10]
19+
20+
steps:
21+
- name: Set up environment
22+
run: |
23+
echo "PYVER=${{ matrix.python-version }}" >> $env:GITHUB_ENV
24+
echo "ZIP_NAME=python-${{ matrix.python-version }}-dev.zip" >> $env:GITHUB_ENV
25+
26+
27+
- name: Install official Python via Chocolatey
28+
shell: pwsh
29+
run: |
30+
choco install python --version=${{ matrix.python-version }} -y --force --no-progress
31+
$ver = "${{ matrix.python-version }}"
32+
$pyVer = $ver -replace '^(\d+\.\d+).*$', '$1'
33+
$installPath = & py -$pyVer -c "import sys, os; print(os.path.dirname(sys.executable))"
34+
echo "PYTHON_PATH=$installPath" >> $env:GITHUB_ENV
35+
echo "Installed Python at: $installPath"
36+
37+
- name: Collect include and libs
38+
shell: pwsh
39+
run: |
40+
$outDir = "output"
41+
mkdir $outDir -Force
42+
xcopy "${env:PYTHON_PATH}\include" "$outDir\include" /E /I /H /K /Y
43+
xcopy "${env:PYTHON_PATH}\libs" "$outDir\libs" /E /I /H /K /Y
44+
Compress-Archive -Path "$outDir\*" -DestinationPath ${env:ZIP_NAME}
45+
echo "Created ${env:ZIP_NAME}"
46+
47+
- name: Upload to release
48+
uses: softprops/action-gh-release@v2
49+
with:
50+
tag_name: python_dev_release
51+
name: Python dev files for Windows
52+
draft: true
53+
preserve_order: true
54+
overwrite_files: true
55+
files: ${{ env.ZIP_NAME }}

0 commit comments

Comments
 (0)