forked from kpu/kenlm
-
Notifications
You must be signed in to change notification settings - Fork 3
109 lines (95 loc) · 3.36 KB
/
wheels.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
name: Build distribution
on: [push, pull_request]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macOS-11, macOS-12]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: maxim-lobanov/setup-xcode@v1
if: matrix.os == 'macOS-11' || matrix.os == 'macOS-12'
with:
xcode-version: latest-stable
- name: Build package
uses: pypa/[email protected]
with:
output-dir: wheelhouse
env:
CIBW_BEFORE_ALL_MACOS:
brew update &&
brew upgrade cmake &&
brew install boost &&
pip install --upgrade pip
CIBW_BEFORE_ALL_LINUX: "
{ yum makecache && yum install -y boost-devel; } ||
{ apt-get update && apt-get install libboost-all-dev; }
"
CIBW_ARCHS_MACOS: x86_64
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7, <3.11"
CIBW_SKIP: "pp* *-manylinux_i686 *-musllinux_*"
# TODO: Try to get builds to work on Python 3.8
# - name: Build wheels on MacOS arm64 + Python 3.8
# if: matrix.os == "macOS-11"
# uses: pypa/[email protected]
# with:
# output-dir: wheelhouse
# env:
# CIBW_BEFORE_ALL_MACOS:
# curl -o /tmp/Python38.pkg https://www.python.org/ftp/python/3.8.10/python-3.8.10-macos11.pkg &&
# sudo installer -pkg /tmp/Python38.pkg -target / &&
# sh "/Applications/Python 3.8/Install Certificates.command" &&
# brew update &&
# brew install boost
# CIBW_BEFORE_ALL_LINUX: yum install boost-devel
# CIBW_ARCHS_MACOS: arm64
# CIBW_PROJECT_REQUIRES_PYTHON: "3.8"
# TODO: Find a solution for building ARM binaries on macOS.
# - name: Build wheels on MacOS arm64 + Python 3.9+
# if: matrix.os == 'macOS-11' || matrix.os == 'macOS-12'
# uses: pypa/[email protected]
# with:
# output-dir: wheelhouse
# env:
# CIBW_BEFORE_ALL_MACOS:
# brew update &&
# brew upgrade cmake &&
# brew install boost &&
# pip install --upgrade pip
# CIBW_ARCHS_MACOS: arm64
# CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9"
# CIBW_SKIP: "pp* *-musllinux_*"
# CMAKE_OSX_ARCHITECTURES: arm64
# CMAKE_APPLE_SILICON_PROCESSOR: arm64
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'push'
# if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_test_password }}
repository_url: https://test.pypi.org/legacy/
verify_metadata: false