-
-
Notifications
You must be signed in to change notification settings - Fork 133
105 lines (89 loc) · 2.79 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
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:
runs-on: 'windows-2019'
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- 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:
strategy:
fail-fast: false
matrix:
py:
- 'cpython-3.8'
- 'cpython-3.9'
- 'cpython-3.10'
- 'cpython-3.11'
- 'cpython-3.12'
vcvars:
- 'vcvars32.bat'
- 'vcvars64.bat'
profile:
- '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@49f298a7ebb00d4b3ddf58000c3e78eff5fbd6b9
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\2019\Enterprise\VC\Auxiliary\Build\${{ matrix.vcvars }}"
py.exe -3.9 build-windows.py --python ${{ matrix.py }} --sh c:\cygwin\bin\sh.exe --profile ${{ matrix.profile }}
- 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.profile }}
path: dist/*