Skip to content

Commit 0f703d8

Browse files
committed
ci: add github actions
1 parent ab27009 commit 0f703d8

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed

.github/workflows/wheels.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Wheels
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
release:
10+
types:
11+
- published
12+
13+
jobs:
14+
build_sdist:
15+
name: Build SDist
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: true
21+
22+
- name: Build SDist
23+
run: pipx run build --sdist
24+
25+
- name: Check metadata
26+
run: pipx run twine check dist/*
27+
28+
- uses: actions/upload-artifact@v4
29+
with:
30+
name: cibw-sdist
31+
path: dist/*.tar.gz
32+
33+
34+
build_wheels:
35+
name: Wheels on ${{ matrix.os }}
36+
runs-on: ${{ matrix.os }}
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
os: [ubuntu-latest, windows-latest, macos-13]
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
with:
45+
submodules: true
46+
47+
- uses: pypa/cibuildwheel@v2.17
48+
env:
49+
CIBW_ARCHS_MACOS: auto universal2
50+
51+
- name: Verify clean directory
52+
run: git diff --exit-code
53+
shell: bash
54+
55+
- name: Upload wheels
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: cibw-wheels-${{ matrix.os }}
59+
path: wheelhouse/*.whl
60+
61+
62+
upload_all:
63+
name: Upload if release
64+
needs: [build_wheels, build_sdist]
65+
runs-on: ubuntu-latest
66+
if: github.event_name == 'release' && github.event.action == 'published'
67+
68+
steps:
69+
- uses: actions/setup-python@v5
70+
with:
71+
python-version: "3.x"
72+
73+
- uses: actions/download-artifact@v4
74+
with:
75+
pattern: cibw-*
76+
path: dist
77+
merge-multiple: true
78+
79+
- uses: pypa/gh-action-pypi-publish@release/v1
80+
with:
81+
password: ${{ secrets.pypi_password }}

0 commit comments

Comments
 (0)