Skip to content

Commit ac670c0

Browse files
committed
Refactor of GitHub action for wheel build process
1 parent f9dc576 commit ac670c0

File tree

5 files changed

+195
-2
lines changed

5 files changed

+195
-2
lines changed

.github/workflows/wheels.yaml

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
#A* -------------------------------------------------------------------
2+
#B* This file contains source code for running a GitHub automation
3+
#-* related to the build process of the PyMOL computer program
4+
#C* Copyright 2025 by Martin Urban.
5+
#D* -------------------------------------------------------------------
6+
#E* It is unlawful to modify or remove this copyright notice.
7+
#F* -------------------------------------------------------------------
8+
#G* Please see the accompanying LICENSE file for further information.
9+
#H* -------------------------------------------------------------------
10+
#I* Additional authors of this source file include:
11+
#-*
12+
#-*
13+
#-*
14+
#Z* -------------------------------------------------------------------
15+
name: Build wheel files for all major operating systems
16+
17+
on: [push]
18+
19+
env:
20+
VCPKG_ROOT: ${{ github.workspace }}/vendor/vcpkg
21+
22+
jobs:
23+
# ----- Windows build section
24+
build-windows:
25+
strategy:
26+
fail-fast: false
27+
runs-on: windows-latest
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
submodules: recursive
33+
34+
- name: Initialize vcpkg
35+
run: |
36+
git clone https://github.com/Microsoft/vcpkg.git vendor/vcpkg
37+
38+
- name: Setup Python 3.11
39+
uses: actions/setup-python@v5
40+
with:
41+
python-version: "3.11"
42+
43+
- name: Create virtual environment
44+
run: |
45+
python -m venv .venv
46+
call .venv\Scripts\activate.bat
47+
python -m pip install --upgrade setuptools pip wheel build cibuildwheel
48+
python -m pip install -r requirements.txt
49+
shell: cmd
50+
51+
- name: Bootstrap vcpkg
52+
run: ${{ env.VCPKG_ROOT }}/bootstrap-vcpkg.bat -disableMetrics
53+
54+
- name: Install vcpkg dependencies
55+
run: |
56+
${{ env.VCPKG_ROOT }}/vcpkg install --triplet=x64-windows-static
57+
58+
- name: Build extension
59+
run: |
60+
call .venv\Scripts\activate.bat
61+
python automations/my_automator.py setup dev-env
62+
cibuildwheel .
63+
shell: cmd
64+
65+
- name: Upload artifact
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: PyMOL-wheel-Windows-3.11
69+
path: ./wheelhouse/*.whl
70+
# --- end
71+
72+
# ----- macOS build section
73+
build-macos:
74+
strategy:
75+
fail-fast: false
76+
matrix:
77+
os: [ macos-13, macos-14 ]
78+
python-version: [ "3.11" ]
79+
runs-on: ${{ matrix.os }}
80+
steps:
81+
- name: Checkout repository
82+
uses: actions/checkout@v4
83+
with:
84+
submodules: recursive
85+
86+
- name: Initialize vcpkg
87+
run: |
88+
git clone https://github.com/Microsoft/vcpkg.git vendor/vcpkg
89+
90+
- name: Setup Python 3.11
91+
uses: actions/setup-python@v5
92+
with:
93+
python-version: "3.11"
94+
95+
- name: Create virtual environment
96+
run: |
97+
python -m venv .venv
98+
source .venv/bin/activate
99+
python -m pip install wheel setuptools cibuildwheel
100+
python -m pip install -r requirements.txt
101+
102+
- name: Bootstrap vcpkg
103+
run: ${{ env.VCPKG_ROOT }}/bootstrap-vcpkg.sh -disableMetrics
104+
105+
- name: Install vcpkg dependencies
106+
run: |
107+
${{ env.VCPKG_ROOT }}/vcpkg install
108+
109+
- name: Last build environment setup steps
110+
run: |
111+
source .venv/bin/activate
112+
python automations/my_automator.py setup dev-env
113+
114+
- name: Build C extension
115+
run: |
116+
source .venv/bin/activate
117+
python automations/my_automator.py setup dev-env
118+
export ARCH=$(uname -m)
119+
export MACOSX_DEPLOYMENT_TARGET=12.0
120+
cibuildwheel .
121+
122+
- name: Upload artifact
123+
uses: actions/upload-artifact@v4
124+
with:
125+
name: PyMOL-wheel-${{ matrix.os }}-3.11
126+
path: ./wheelhouse/*.whl
127+
# --- end
128+
129+
# ----- GNU Linux build section
130+
build-gnu-linux:
131+
strategy:
132+
fail-fast: false
133+
runs-on: ubuntu-22.04
134+
steps:
135+
- name: Checkout repository
136+
uses: actions/checkout@v4
137+
with:
138+
submodules: recursive
139+
140+
- name: Install system dependencies
141+
run: |
142+
sudo apt-get update
143+
sudo apt-get install git build-essential libxmu-dev libxi-dev libgl-dev libglew-dev libpng-dev libfreetype6-dev libxml2-dev libmsgpack-dev libglm-dev libnetcdf-dev linux-libc-dev autoconf perl
144+
145+
- name: Initialize vcpkg
146+
run: |
147+
git clone https://github.com/Microsoft/vcpkg.git vendor/vcpkg
148+
149+
- name: Setup Python 3.11
150+
uses: actions/setup-python@v5
151+
with:
152+
python-version: "3.11"
153+
154+
- name: Create virtual environment
155+
run: |
156+
python -m venv .venv
157+
source .venv/bin/activate
158+
python -m pip install wheel setuptools cibuildwheel
159+
python -m pip install -r requirements.txt
160+
161+
- name: Bootstrap vcpkg
162+
run: ${{ env.VCPKG_ROOT }}/bootstrap-vcpkg.sh -disableMetrics
163+
164+
- name: Install vcpkg dependencies
165+
run: |
166+
${{ env.VCPKG_ROOT }}/vcpkg install
167+
168+
- name: Last build environment setup steps
169+
run: |
170+
source .venv/bin/activate
171+
python automations/my_automator.py setup dev-env
172+
173+
- name: Build C extension
174+
run: |
175+
source .venv/bin/activate
176+
python automations/my_automator.py setup dev-env
177+
cibuildwheel .
178+
179+
- name: Upload artifact
180+
uses: actions/upload-artifact@v4
181+
with:
182+
name: PyMOL-wheel-GNU-Linux-3.11
183+
path: ./wheelhouse/*.whl
184+
# --- end

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,11 @@ pymol2 = "modules/pymol2"
6565

6666
[tool.cibuildwheel]
6767
build = ["cp310-*", "cp311-*", "cp312-*"]
68+
# build = ["cp311-*"] # Only for debug purposes
69+
# Skip 32-bit builds
70+
skip = ["*-win32", "*-manylinux_i686"]
6871
test-requires = ["pytest", "importlib_metadata"]
6972
test-command = "pytest {project}/tests/"
73+
74+
[tool.cibuildwheel.environment]
75+
VCPKG_ROOT = "{project}/vendor/vcpkg"

vcpkg.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"name": "pymol-oss-dependencies",
33
"version": "1.0.0",
4-
"builtin-baseline": "d7112d1a4fb50410d3639f5f586972591d848beb",
4+
"builtin-baseline": "d172727ef04337ef0021640302a9a3a91ad17414",
55
"dependencies": [
6-
"freetype",
6+
{
7+
"name": "freetype",
8+
"version>=": "2.13.3"
9+
},
710
"glew",
811
"glm",
912
"libpng",

0 commit comments

Comments
 (0)