-
Notifications
You must be signed in to change notification settings - Fork 51
67 lines (63 loc) · 1.61 KB
/
build_for_pypi.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
---
name: Build and Optionally Publish to PyPi
on:
pull_request:
branches: main
workflow_call:
inputs:
publish:
type: boolean
default: false
description: "Publish to PyPi"
jobs:
build_src_for_pypi:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: true
- name: Install dependencies
run: |
pip install build
- name: Build src dist
run: |
python -m build --sdist
env:
PIP_CONSTRAINT: requirements.txt
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: ./**/*.tar.gz
build_dist_for_pypi:
needs:
- build_src_for_pypi
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-13
- macos-latest
- ubuntu-24.04-arm
- ubuntu-latest
- windows-latest
steps:
- name: Download the sdist
uses: actions/download-artifact@v4
with:
name: cibw-sdist
- name: Get sdist filename
id: get-sdist
run: |
echo "sdist_filename=$(ls dist/)" >> "${GITHUB_OUTPUT}"
shell: bash
- name: Build wheels
uses: pypa/[email protected]
with:
package-dir: dist/${{ steps.get-sdist.outputs.sdist_filename }}
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}
path: ./wheelhouse/*.whl