Skip to content

Commit 04b0b2c

Browse files
committed
Add GitHub Actions workflows for building and deploying
1 parent 923eefd commit 04b0b2c

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Build
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build_wheels:
8+
name: Build wheels on ${{ matrix.os }}
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
# macos-13 is an intel runner, macos-14 is apple silicon
13+
os: [ubuntu-latest]
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Build wheels
19+
run: pipx run cibuildwheel==2.20.0
20+
21+
- uses: actions/upload-artifact@v4
22+
with:
23+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
24+
path: ./wheelhouse/*.whl

.github/workflows/build_deploy.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Build and upload to PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types:
7+
- published
8+
9+
jobs:
10+
build_wheels:
11+
name: Build wheels on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
# macos-13 is an intel runner, macos-14 is apple silicon
16+
os: [ubuntu-latest]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Build wheels
22+
uses: pypa/[email protected]
23+
24+
- uses: actions/upload-artifact@v4
25+
with:
26+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
27+
path: ./wheelhouse/*.whl
28+
29+
build_sdist:
30+
name: Build source distribution
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Build sdist
36+
run: pipx run build --sdist
37+
38+
- uses: actions/upload-artifact@v4
39+
with:
40+
name: cibw-sdist
41+
path: dist/*.tar.gz
42+
43+
upload_pypi:
44+
needs: [build_wheels, build_sdist]
45+
runs-on: ubuntu-latest
46+
environment: pypi
47+
permissions:
48+
id-token: write
49+
if: github.event_name == 'release' && github.event.action == 'published'
50+
steps:
51+
- uses: actions/download-artifact@v4
52+
with:
53+
# unpacks all CIBW artifacts into dist/
54+
pattern: cibw-*
55+
path: dist
56+
merge-multiple: true
57+
58+
- uses: pypa/gh-action-pypi-publish@release/v1
59+
with:
60+
password: ${{ secrets.PYPI_API_TOKEN }}
File renamed without changes.

0 commit comments

Comments
 (0)