-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (52 loc) · 1.59 KB
/
pythonpublish.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
---
name: Build Python Wheels
"on":
push:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip cython
pip install setuptools wheel cibuildwheel
- name: Run test suite
run: python -m unittest fastbencode.tests.test_suite
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
if: "matrix.os == 'ubuntu-latest'"
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_ARCHS_LINUX: x86_64 aarch64
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
CIBW_ARCHS_WINDOWS: AMD64 x86
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
publish:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/setup-python@v3
- name: Install twine
run: |
python -m pip install --upgrade pip
pip install twine
- name: Download wheels
uses: actions/download-artifact@v2
- name: Display structure of downloaded files
run: ls -R
- name: Publish wheels
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload artifact/*.whl