forked from jansegre/python-rocksdb
-
Notifications
You must be signed in to change notification settings - Fork 5
133 lines (118 loc) · 4.33 KB
/
wheels.yml
File metadata and controls
133 lines (118 loc) · 4.33 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# yamllint disable rule:line-length
name: Build distribution
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches:
- master
- main
- dev
- release*
tags:
- v*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
sdist:
runs-on: ubuntu-latest
name: Build sdists
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- uses: astral-sh/setup-uv@v5
- name: Make sdist
run: uv build --sdist
- run: ls dist
- uses: actions/upload-artifact@v4
name: Upload build artifacts
with:
name: sdist
path: dist/rocksdb*
manylinux:
needs: [sdist]
name: Build wheels
runs-on: ${{ matrix.manylinux.runner }}
container: quay.io/pypa/${{ matrix.manylinux.name }}
# env:
# LIBROCKSDB_PATH: /opt/rocksdb-${{ matrix.rocksdb_ver }}
strategy:
matrix:
# rocksdb_ver: ['8.11.fb']
python:
- { version: "cp312-cp312" }
# - { version: "cp311-cp311" }
manylinux:
- { name: "manylinux_2_28_x86_64", runner: "ubuntu-latest" }
- { name: "manylinux_2_28_aarch64", runner: "ubuntu-24.04-arm" }
- { name: "manylinux_2_34_x86_64", runner: "ubuntu-latest" }
- { name: "manylinux_2_34_aarch64", runner: "ubuntu-24.04-arm" }
steps:
- uses: actions/download-artifact@v4
with:
name: sdist
- name: Install libraries
run: yum install -y rocksdb rocksdb-devel snappy snappy-devel zlib zlib-devel bzip2 bzip2-devel lz4-devel libzstd-devel
- run: mkdir tmpwheelhouse
- name: Build the wheel
run: uv build --python=/opt/python/${{ matrix.python.version }}/bin/python --wheel rocksdb*.tar.gz -o tmpwheelhouse/
- run: auditwheel repair --plat ${{ matrix.manylinux.name }} tmpwheelhouse/rocksdb*.whl -w wheelhouse/
- uses: actions/upload-artifact@v4
with:
name: "rocksdb-v0.0.0-${{ matrix.manylinux.name }}-${{ matrix.python.version }}"
path: wheelhouse/
# - name: Install cibuildwheel
# run: |
# python3 -m pip install cibuildwheel==1.7.1
# - name: Build wheels
# run: |
# python3 -m cibuildwheel --output-dir dist
# env:
# CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
# CIBW_BUILD: 'cp31*'
# CIBW_SKIP: '*-manylinux_i686'
# # Install python package and test-deps.
# CIBW_TEST_REQUIRES: '.[test] pytest'
# # Use `--pyargs` to interpret parameter as module to import, not as a
# # path, and do not use `python3 -m pytest`. This way we prevent
# # importing the module from the current directory instead of the
# # installed package, and failing when it cannot find the shared
# # library.
# CIBW_TEST_COMMAND: 'pytest --pyargs rocksdb'
# # Avoid re-building the C library in every iteration by testing for
# # the build directory.
# CIBW_BEFORE_BUILD: >
# yum install -y snappy snappy-devel zlib zlib-devel bzip2 bzip2-devel lz4-devel libzstd-devel &&
# test -d ${{ env.LIBROCKSDB_PATH }} || (
# git clone https://github.com/facebook/rocksdb --depth 1
# --branch ${{ matrix.rocksdb_ver }} ${{ env.LIBROCKSDB_PATH }} &&
# cd ${{ env.LIBROCKSDB_PATH }} &&
# CXXFLAGS='-flto -Os -s' PORTABLE=1 make shared_lib -j 4
# ) &&
# pushd ${{ env.LIBROCKSDB_PATH }} &&
# make install-shared &&
# ldconfig &&
# popd
# - uses: actions/upload-artifact@v4
# name: Upload build artifacts
# with:
# path: 'dist/*.whl'
# publish:
# name: Upload packages
# needs: [manylinux, sdist]
# runs-on: 'ubuntu-latest'
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
# steps:
# - uses: actions/download-artifact@v4
# name: 'Download artifacts'
# with:
# name: 'artifact'
# path: 'dist'
#
# - uses: pypa/gh-action-pypi-publish@master
# name: 'Publish built packages'
# with:
# user: '__token__'
# password: '${{ secrets.PYPI_API_TOKEN }}'