-
Notifications
You must be signed in to change notification settings - Fork 48
76 lines (64 loc) · 1.82 KB
/
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
name: release
on:
push:
tags:
- v*
pull_request:
jobs:
builds:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-11, windows-2022]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.2
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BEFORE_BUILD: pip install cython==3.0.8 && pip install -e . && python build.py
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest --showlocals {package}/tests
CIBW_SKIP: "{cp36**,pp*}"
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_ARCHS_LINUX: auto aarch64
CIBW_BUILD_VERBOSITY: 3
- uses: actions/upload-artifact@v4
with:
overwrite: true
name: wheelhouse
path: ./wheelhouse/*.whl
upload:
# Skip this step on pull requests. Run only when pushing a version tag.
if: startsWith(github.ref, 'refs/tags/v')
needs: builds
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Stage wheels
uses: actions/download-artifact@v4
with:
name: wheelhouse
path: wheelhouse
- run: |
mkdir dist
mv -v wheelhouse/* dist/
ls -l dist/
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}