Repository navigation
154 lines (145 loc) · 5.28 KB
/
Copy pathmain.yml
File metadata and controls
154 lines (145 loc) · 5.28 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
146
147
148
149
150
151
152
153
154
name: Build
on:
push: {}
pull_request: {}
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- cpython_branch: "3.14"
cpython_commit: 8e6e75d9102e39bed2a2b279203a396741180f12
arch: x64
platform: amd64
build_args: ""
os: windows-2022
- cpython_branch: "3.15"
cpython_commit: d220409a13b77de7a6c30abe16ea90db01528edc # v3.15.0
arch: x64
platform: amd64
build_args: ""
os: windows-2022
runs-on: ${{ matrix.os }}
steps:
- name: Set up python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.14"
- 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@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
archive: false
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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- run: mkdir dist
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
skip-decompress: true
merge-multiple: true
path: ./dist
- run: ./deploy.sh ./dist/*.zip
env:
RELEASES_API_KEY: ${{ secrets.GITHUB_TOKEN }}