Skip to content

Commit 529205f

Browse files
committed
added wheel publish github action
1 parent 813636b commit 529205f

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Upload Python Wheels
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
checkout_ref:
7+
description: "The branch, tag or SHA to checkout."
8+
required: true
9+
default: "master"
10+
11+
jobs:
12+
linux-deploy:
13+
runs-on: ubuntu-latest
14+
container: quay.io/pypa/manylinux2014_x86_64
15+
strategy:
16+
matrix:
17+
python: ["cp38-cp38", "cp39-cp39", "cp310-cp310", "cp311-cp311"]
18+
steps:
19+
- uses: actions/checkout@v1
20+
with:
21+
ref: ${{ inputs.checkout_ref }}
22+
- name: Build wheel
23+
env:
24+
PYTHON: /opt/python/${{ matrix.python }}/bin/python
25+
run: |
26+
$PYTHON -m pip install "cython<3" oldest-supported-numpy
27+
$PYTHON -m build --no-isolation
28+
auditwheel repair dist/*linux_x86_64.whl
29+
- name: Publish to pypi
30+
env:
31+
TWINE_USERNAME: __token__
32+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
33+
run: |
34+
pipx install twine
35+
twine upload dist/*.tar.gz --skip-existing
36+
twine upload wheelhouse/*.whl --skip-existing
37+
other-deploy:
38+
strategy:
39+
matrix:
40+
python: ["3.8", "3.9", "3.10", "3.11"]
41+
os: [windows-2019, macos-11]
42+
runs-on: ${{ matrix.os }}
43+
steps:
44+
- uses: actions/checkout@v1
45+
with:
46+
ref: ${{ inputs.checkout_ref }}
47+
- name: Set up Python
48+
uses: actions/setup-python@v1
49+
with:
50+
python-version: ${{ matrix.python }}
51+
- name: Install dependencies
52+
run: |
53+
python -m pip install --upgrade pip
54+
pip install setuptools build wheel twine
55+
pip install "cython<3" oldest-supported-numpy
56+
- name: Build wheel
57+
run: |
58+
python -m build --no-isolation
59+
- name: Publish to pypi
60+
env:
61+
TWINE_USERNAME: __token__
62+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
63+
run: |
64+
twine upload dist/*.whl --skip-existing

0 commit comments

Comments
 (0)