-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (72 loc) · 2.21 KB
/
build-cpython.yml
File metadata and controls
88 lines (72 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Build CPython (Windows)
on:
workflow_dispatch:
inputs:
python_version:
description: "CPython version to build (e.g. 3.12.10, 3.12.12)"
required: true
default: "3.12.12"
permissions:
contents: write # 创建 Release 需要
jobs:
build-python:
runs-on: windows-latest
env:
PY_VER: ${{ inputs.python_version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Show build version
run: |
echo Building CPython %PY_VER% for Windows x64
shell: cmd
- name: Download CPython source
run: |
curl -L -o Python-%PY_VER%.tgz https://www.python.org/ftp/python/%PY_VER%/Python-%PY_VER%.tgz
shell: cmd
- name: Extract source
run: |
tar -xvf Python-$PY_VER.tgz
shell: bash
- name: List extracted content
run: |
dir
dir Python-%PY_VER%
shell: cmd
- name: Prepare external deps
run: |
cd Python-%PY_VER%\PCbuild
call get_externals.bat
shell: cmd
- name: Build CPython (Release x64)
run: |
cd Python-%PY_VER%\PCbuild
call build.bat -c Release -p x64
shell: cmd
- name: Collect build outputs
run: |
mkdir output
copy Python-%PY_VER%\PCbuild\amd64\* output\
shell: cmd
- name: Pack to 7z (max compression)
run: |
7z a -t7z -m0=lzma2 -mx=9 -mmt=on cpython-%PY_VER%-win64.7z .\output\*
shell: cmd
- name: Upload artifact (7z)
uses: actions/upload-artifact@v4
with:
name: cpython-${{ env.PY_VER }}-win64
path: cpython-${{ env.PY_VER }}-win64.7z
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.PY_VER }}-win64
name: CPython ${{ env.PY_VER }} for Windows x64
body: |
CPython ${{ env.PY_VER }} for Windows x64, built on GitHub Actions.
- Version: ${{ env.PY_VER }}
- Platform: Windows x64
files: |
cpython-${{ env.PY_VER }}-win64.7z
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}