-
-
Notifications
You must be signed in to change notification settings - Fork 142
111 lines (94 loc) · 3.08 KB
/
windows.yml
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
name: Windows Python build
on:
push:
branches: [main]
pull_request:
schedule:
- cron: '13 11 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
pythonbuild:
if: ${{ github.repository_owner == 'indygreg' || github.event_name != 'schedule' }}
runs-on: 'windows-2022'
steps:
- uses: actions/checkout@v4
- name: Emit rustc version
run: |
rustc --version > .rustc-version
- uses: actions/cache@v4
with:
path: |
C:/Rust/.cargo/registry
C:/Rust/.cargo/git
target
key: ${{ runner.os }}-pythonbuild-${{ hashFiles('Cargo.lock', '.rustc-version') }}
- name: Build
run: |
cargo build --release
- name: Upload executable
uses: actions/upload-artifact@v4
with:
name: pythonbuild
path: target/release/pythonbuild.exe
build:
if: ${{ github.repository_owner == 'indygreg' || github.event_name != 'schedule' }}
strategy:
fail-fast: false
matrix:
py:
- 'cpython-3.9'
- 'cpython-3.10'
- 'cpython-3.11'
- 'cpython-3.12'
- 'cpython-3.13'
vcvars:
- 'vcvars32.bat'
- 'vcvars64.bat'
options:
- 'pgo'
include:
- py: 'cpython-3.13'
vcvars: 'vcvars32.bat'
options: 'freethreaded+pgo'
- py: 'cpython-3.13'
vcvars: 'vcvars64.bat'
options: 'freethreaded+pgo'
needs: pythonbuild
runs-on: 'windows-2019'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Cygwin Environment
uses: cygwin/cygwin-install-action@3bb2cf578250d22bed46555cbf300b22266ef287
with:
packages: autoconf automake libtool
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Download pythonbuild Executable
uses: actions/download-artifact@v4
with:
name: pythonbuild
# We need to do this before we activate the VC++ environment or else binary packages
# don't get compiled properly.
- name: Bootstrap Python environment
run: |
py.exe -3.9 build-windows.py --help
- name: Build
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\${{ matrix.vcvars }}"
py.exe -3.9 build-windows.py --python ${{ matrix.py }} --sh c:\cygwin\bin\sh.exe --options ${{ matrix.options }}
- name: Validate Distribution
run: |
$Dists = Resolve-Path -Path "dist/*.tar.zst" -Relative
.\pythonbuild.exe validate-distribution --run $Dists
- name: Upload Distributions
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.py }}-${{ matrix.vcvars }}-${{ matrix.options }}
path: dist/*