@@ -6,31 +6,31 @@ name: Build wheels
66on :
77 push :
88 branches :
9- - main
9+ - main
1010 paths :
11- - ' nlpo3-python/**'
12- - ' .github/workflows/build-python-wheels.yml'
11+ - " nlpo3-python/**"
12+ - " .github/workflows/build-python-wheels.yml"
1313 pull_request :
1414 branches :
15- - main
15+ - main
1616 paths :
17- - ' nlpo3-python/**'
18- - ' .github/workflows/build-python-wheels.yml'
17+ - " nlpo3-python/**"
18+ - " .github/workflows/build-python-wheels.yml"
1919 release :
2020 types : [published]
21- workflow_dispatch : {} # manual run
21+ workflow_dispatch : {} # manual run
2222
2323jobs :
2424 echo_github_env :
2525 name : Echo env variables
2626 runs-on : ubuntu-latest
2727 steps :
28- - run : |
29- echo "github.event.action : ${{ github.event.action }}"
30- echo "github.event_name : ${{ github.event_name }}"
31- echo "github.ref : ${{ github.ref }}"
32- echo "github.ref_type : ${{ github.ref_type }}"
33- echo "github.event.ref : ${{ github.event.ref }}"
28+ - run : |
29+ echo "github.event.action : ${{ github.event.action }}"
30+ echo "github.event_name : ${{ github.event_name }}"
31+ echo "github.ref : ${{ github.ref }}"
32+ echo "github.ref_type : ${{ github.ref_type }}"
33+ echo "github.event.ref : ${{ github.event.ref }}"
3434
3535 # Check whether to build the wheels and the source tarball
3636 check_build_trigger :
@@ -41,14 +41,14 @@ jobs:
4141 outputs :
4242 build : ${{ steps.check_build_trigger.outputs.build }}
4343 steps :
44- - name : Checkout source code
45- uses : actions/checkout@v4
46- with :
47- ref : ${{ github.event.pull_request.head.sha }}
48- - id : check_build_trigger
49- name : Check build trigger
50- run : bash build_tools/github/check_build_trigger.sh
51- # To trigger the build steps, add "[cd build]" to commit message
44+ - name : Checkout source code
45+ uses : actions/checkout@v4
46+ with :
47+ ref : ${{ github.event.pull_request.head.sha }}
48+ - id : check_build_trigger
49+ name : Check build trigger
50+ run : bash build_tools/github/check_build_trigger.sh
51+ # To trigger the build steps, add "[cd build]" to commit message
5252
5353 build_wheels :
5454 name : Build ${{ matrix.os }}
@@ -60,84 +60,84 @@ jobs:
6060 fail-fast : false
6161 matrix :
6262 os : [macos-latest, ubuntu-latest, windows-latest]
63- python-version : ["3.13"]
63+ python-version : ["3.14"] # Check with PyO3's maximum supported version
6464 env :
65- CIBW_BUILD : " " # blank, let cibuildwheel build all supported platforms
65+ CIBW_BUILD : " " # blank, let cibuildwheel build all supported platforms
6666
6767 steps :
68- - name : Checkout source code
69- uses : actions/checkout@v6
68+ - name : Checkout source code
69+ uses : actions/checkout@v6
7070
71- - name : Setup Python
72- uses : actions/setup-python@v6
73- with :
74- python-version : ${{ matrix.python-version }}
75- cache : " pip"
76- - name : Install Python dependencies
77- run : python -m pip install --upgrade pip
71+ - name : Setup Python
72+ uses : actions/setup-python@v6
73+ with :
74+ python-version : ${{ matrix.python-version }}
75+ cache : " pip"
76+ - name : Install Python dependencies
77+ run : python -m pip install --upgrade pip
7878
79- - name : Setup Rust toolchain
80- if : startsWith(matrix.os, 'ubuntu-') == false
81- uses : actions-rust-lang/setup-rust-toolchain@v1
82- # For Linux, Rust will be installed inside a cibuildwheel container later
79+ - name : Setup Rust toolchain
80+ if : startsWith(matrix.os, 'ubuntu-') == false
81+ uses : actions-rust-lang/setup-rust-toolchain@v1
82+ # For Linux, Rust will be installed inside a cibuildwheel container later
8383
84- - name : Setup rustup target
85- if : startsWith(matrix.os, 'macos-')
86- run : rustup target add x86_64-apple-darwin
87- # For cross-compile x86 on GitHub arm64 runner
84+ - name : Setup rustup target
85+ if : startsWith(matrix.os, 'macos-')
86+ run : rustup target add x86_64-apple-darwin
87+ # For cross-compile x86 on GitHub arm64 runner
8888
89- - name : Build Python wheels
90- uses : pypa/cibuildwheel@v3
91- with :
92- package-dir : nlpo3-python
93- output-dir : wheelhouse
94- env :
95- CIBW_BUILD_VERBOSITY : 1
96- # See CIBW_BUILD, CIBW_SKIP, CIBW_ARCHS and other build selectors at:
97- # https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
98- CIBW_SKIP : " *-musllinux_i686"
99- CIBW_ARCHS_MACOS : " x86_64 arm64"
100- CIBW_ENVIRONMENT_MACOS : |
101- MACOSX_DEPLOYMENT_TARGET=10.9
102- PATH="$HOME/.cargo/bin:$PATH"
103- CC=/usr/bin/clang
104- CXX=/usr/bin/clang++
105- CIBW_ARCHS_LINUX : " auto"
106- CIBW_ENVIRONMENT_LINUX : PATH="$HOME/.cargo/bin:$PATH"
107- CIBW_BEFORE_BUILD_LINUX : |
108- pip install --upgrade setuptools-rust
109- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
110- # It is needed to install Rust for Linux,
111- # because cibuildwheel on Linux runs inside a container
112- # and the container does not have Rust.
113- CIBW_ARCHS_WINDOWS : " AMD64 x86"
89+ - name : Build Python wheels
90+ uses : pypa/cibuildwheel@v3
91+ with :
92+ package-dir : nlpo3-python
93+ output-dir : wheelhouse
94+ env :
95+ CIBW_BUILD_VERBOSITY : 1
96+ # See CIBW_BUILD, CIBW_SKIP, CIBW_ARCHS and other build selectors at:
97+ # https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
98+ CIBW_SKIP : " *-musllinux_i686"
99+ CIBW_ARCHS_MACOS : " x86_64 arm64"
100+ CIBW_ENVIRONMENT_MACOS : |
101+ MACOSX_DEPLOYMENT_TARGET=10.9
102+ PATH="$HOME/.cargo/bin:$PATH"
103+ CC=/usr/bin/clang
104+ CXX=/usr/bin/clang++
105+ CIBW_ARCHS_LINUX : " auto"
106+ CIBW_ENVIRONMENT_LINUX : PATH="$HOME/.cargo/bin:$PATH"
107+ CIBW_BEFORE_BUILD_LINUX : |
108+ pip install --upgrade setuptools-rust
109+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
110+ # It is needed to install Rust for Linux,
111+ # because cibuildwheel on Linux runs inside a container
112+ # and the container does not have Rust.
113+ CIBW_ARCHS_WINDOWS : " AMD64 x86"
114114
115- - name : Store artifacts
116- uses : actions/upload-artifact@v6
117- with :
118- path : ./wheelhouse/*.whl
115+ - name : Store artifacts
116+ uses : actions/upload-artifact@v6
117+ with :
118+ path : ./wheelhouse/*.whl
119119
120120 build_sdist :
121121 name : Build source distribution
122122 runs-on : ubuntu-latest
123123 needs : check_build_trigger
124124 if : needs.check_build_trigger.outputs.build
125125 steps :
126- - name : Checkout source code
127- uses : actions/checkout@v6
128- - name : Setup Python
129- uses : actions/setup-python@v6
130- with :
131- python-version : " 3.13 "
132- cache : " pip"
133- - name : Build source distribution
134- run : |
135- cd nlpo3-python
136- bash ../build_tools/github/build_source.sh
137- - name : Store artifacts
138- uses : actions/upload-artifact@v6
139- with :
140- path : nlpo3-python/dist/*.tar.gz
126+ - name : Checkout source code
127+ uses : actions/checkout@v6
128+ - name : Setup Python
129+ uses : actions/setup-python@v6
130+ with :
131+ python-version : " 3.14 " # Check with PyO3's maximum supported version
132+ cache : " pip"
133+ - name : Build source distribution
134+ run : |
135+ cd nlpo3-python
136+ bash ../build_tools/github/build_source.sh
137+ - name : Store artifacts
138+ uses : actions/upload-artifact@v6
139+ with :
140+ path : nlpo3-python/dist/*.tar.gz
141141
142142 publish_pypi :
143143 name : Publish to PyPI
@@ -148,14 +148,14 @@ jobs:
148148 # Alternatively, upload to PyPI on every tag starting with 'v':
149149 # if: github.event_name == 'push' && startsWith(github.event.ref, 'v')
150150 steps :
151- - name : Retrieve artifacts
152- uses : actions/download-artifact@v6
153- with :
154- name : artifact
155- path : dist
156- - name : Publish package
157- uses : pypa/gh-action-pypi-publish@v1
158- with :
159- skip-existing : true
160- user : __token__
161- password : ${{ secrets.PYPI_API_TOKEN }}
151+ - name : Retrieve artifacts
152+ uses : actions/download-artifact@v6
153+ with :
154+ name : artifact
155+ path : dist
156+ - name : Publish package
157+ uses : pypa/gh-action-pypi-publish@v1
158+ with :
159+ skip-existing : true
160+ user : __token__
161+ password : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments