Skip to content

Commit e6ed7d7

Browse files
authored
Create build_distributions.yml
1 parent e6b3a87 commit e6ed7d7

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
ame: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build_wheels:
7+
name: Build wheels on ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
# macos-13 is an intel runner, macos-14 is apple silicon
12+
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Build wheels
18+
uses: pypa/cibuildwheel@v2.21.3
19+
# env:
20+
# CIBW_SOME_OPTION: value
21+
# ...
22+
# with:
23+
# package-dir: .
24+
# output-dir: wheelhouse
25+
# config-file: "{package}/pyproject.toml"
26+
27+
- uses: actions/upload-artifact@v4
28+
with:
29+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
30+
path: ./wheelhouse/*.whl
31+
32+
build_sdist:
33+
name: Build source distribution
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
38+
- name: Build sdist
39+
run: pipx run build --sdist
40+
41+
- uses: actions/upload-artifact@v4
42+
with:
43+
name: cibw-sdist
44+
path: dist/*.tar.gz
45+
46+
upload_pypi:
47+
needs: [build_wheels, build_sdist]
48+
runs-on: ubuntu-latest
49+
environment: pypi
50+
permissions:
51+
id-token: write
52+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
53+
steps:
54+
- uses: actions/download-artifact@v4
55+
with:
56+
# unpacks all CIBW artifacts into dist/
57+
pattern: cibw-*
58+
path: dist
59+
merge-multiple: true
60+
61+
- uses: pypa/gh-action-pypi-publish@release/v1
62+
with:
63+
# To test: repository-url: https://test.pypi.org/legacy/

0 commit comments

Comments
 (0)