-
Notifications
You must be signed in to change notification settings - Fork 49
80 lines (67 loc) · 2.09 KB
/
pypi_release.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
name: Publish to PyPI
on:
push:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
env:
CIBW_BEFORE_ALL_LINUX: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y"
CIBW_BUILD_VERBOSITY: "1"
CIBW_SKIP: cp39-musllinux_i686 cp310-musllinux_i686 cp311-musllinux_i686 cp312-musllinux_i686 # Can't install Rust on musl based Linux systems
CIBW_ENVIRONMENT: 'PATH="$PATH:$HOME/.cargo/bin"'
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Build wheels
uses: pypa/[email protected]
with:
package-dir: ./python
output-dir: ./python/wheelhouse
- uses: actions/upload-artifact@v3
with:
name: wheel-${{ runner.os }}
path: ./python/wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: "3.9"
- name: Build sdist
run: |
python -m pip install setuptools-rust setuptools wheel
cd python/
python setup.py sdist
- uses: actions/upload-artifact@v2
with:
name: sdist-${{ runner.os }}
path: python/dist/*.tar.gz
# release:
# needs: [build_wheels, build_sdist]
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v2
# with:
# name: artifact
# path: python/dist
# - uses: pypa/gh-action-pypi-publish@release/v1
# with:
# packages-dir: python/dist/
# user: __token__
# password: ${{ secrets.PYPI_API_TOKEN }}