-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (60 loc) · 1.72 KB
/
python-publish.yml
File metadata and controls
68 lines (60 loc) · 1.72 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
name: Build and Publish to PyPI
on:
push:
tags:
- 'v*'
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-13, macos-14, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
env:
CIBW_BUILD: "cp310-* cp311-* cp312-*"
CIBW_SKIP: "pp* *musllinux*"
CIBW_BEFORE_BUILD: "pip install torch==2.2.2"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
LD_LIBRARY_PATH=$(python -c 'import torch, os; print(os.path.join(torch.__path__[0], "lib"))'):$LD_LIBRARY_PATH
auditwheel repair
--exclude libtorch*.so
--exclude libc10*.so
--exclude libgomp*.so
-w {dest_dir} {wheel}
- name: Store wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download all
uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist
merge-multiple: true
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
verbose: true