-
Notifications
You must be signed in to change notification settings - Fork 2
145 lines (136 loc) · 4.8 KB
/
main.yml
File metadata and controls
145 lines (136 loc) · 4.8 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: Build
on:
push: {}
pull_request: {}
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- cpython_branch: "3.14"
cpython_commit: 323c59a5e348347be2ce2b7ea55fcb30bf68b2d3
arch: x64
platform: amd64
build_args: ""
os: windows-2022
runs-on: ${{ matrix.os }}
steps:
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Get cpython
shell: bash
run: |
git init cpython
git -C cpython remote add origin https://github.com/python/cpython.git
git -C cpython fetch \
--depth=1000 \
--progress \
origin \
'+refs/heads/${{ matrix.cpython_branch }}:refs/remotes/origin/${{ matrix.cpython_branch }}' \
'+refs/tags/v${{ matrix.cpython_branch }}.*:refs/tags/v${{ matrix.cpython_branch }}.*'
git -C cpython checkout '${{ matrix.cpython_commit }}'
- name: Get vars
id: vars
shell: pwsh
run: |
$d = (.\cpython\PCbuild\build.bat -V) | %{ if($_ -match '\s+(\w+):\s*(.+)\s*$') { @{$Matches[1] = $Matches[2];} }};
echo ("python_version=" + $d.PythonVersion) >> $env:GITHUB_OUTPUT
echo ("git_version=" + (git -C cpython describe --tags --long)) >> $env:GITHUB_OUTPUT
# - name: Get external libs (sources)
# shell: pwsh
# run: |
# .\cpython\PCbuild\get_externals.bat `
# --no-tkinter `
# --tkinter-src `
# --no-openssl `
# --openssl-src `
# --no-libffi `
# --libffi-src
#
# # prepare_tcltk.bat (only build for the arch we're interested in)
# - name: Build Tcl/Tk
# shell: pwsh
# run: |
# $env:MSBUILD = (cmd /v:on /c "call .\cpython\PCbuild\find_msbuild.bat >nul && echo !MSBUILD!")
# & $env:MSBUILD `
# .\cpython\PCbuild\tcl.vcxproj `
# /p:Configuration=Release `
# /p:Platform=$platform
# & $env:MSBUILD `
# .\cpython\PCbuild\tk.vcxproj `
# /p:Configuration=Release `
# /p:Platform=$platform
# & $env:MSBUILD `
# .\cpython\PCbuild\tix.vcxproj `
# /p:Configuration=Release `
# /p:Platform=$platform
#
# # prepare_ssl.bat (only build for the arch we're interested in)
# - name: Build OpenSSL
# shell: pwsh
# run: |
# $platform = If ("${{ matrix.arch }}" -eq "x86") {"Win32"} else {"${{ matrix.arch }}"}
# $env:MSBUILD = (cmd /v:on /c "call .\cpython\PCbuild\find_msbuild.bat >nul && echo !MSBUILD!")
# $env:PYTHON = (Get-Command python.exe).Path
# $env:PERL = (Get-Command perl.exe).Path
# & $env:MSBUILD `
# .\cpython\PCbuild\openssl.vcxproj `
# /p:Configuration=Release `
# /p:Platform=$platform
#
# # prepare_libffi.bat
# - uses: cygwin/cygwin-install-action@ad81540ad7c2726e17c08401fbeca6380cc7f463
# with:
# platform: x86_64
# packages: make,autoconf,automake,libtool,dejagnu
# - name: Build libffi
# shell: pwsh
# run: |
# $env:LIBFFI_SOURCE = (Resolve-Path .\cpython\externals\libffi-*).Path
# $env:SH = "C:\cygwin\bin\sh.exe"
# .\cpython\PCbuild\prepare_libffi.bat -${{ matrix.arch }} -license
- name: Get external libs (pre-built binaries)
shell: pwsh
run: |
.\cpython\PCbuild\get_externals.bat
- name: Build
shell: pwsh
run: |
.\cpython\PCbuild\build.bat -v -c Release -p ${{ matrix.arch }} ${{ matrix.build_args }}
- name: Package
shell: pwsh
run: |
.\cpython\PCbuild\${{ matrix.platform }}\python.exe `
.\cpython\PC\layout `
-vv `
--source .\cpython `
--build .\cpython\PCbuild\${{ matrix.platform }} `
--arch ${{ matrix.platform }} `
--temp .\temp `
--precompile `
--include-underpth `
--zip-lib `
--zip "python-${{ steps.vars.outputs.git_version }}-windows-${{ matrix.arch }}-embed.zip"
- uses: actions/upload-artifact@v4
with:
name: python-${{ steps.vars.outputs.git_version }}-windows-${{ matrix.arch }}-embed
path: ./*.zip
deploy:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
needs:
- build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- run: mkdir dist
- uses: actions/download-artifact@v4
with:
path: ./dist
- run: ./deploy.sh ./dist/**/*.zip
env:
RELEASES_API_KEY: ${{ secrets.GITHUB_TOKEN }}