-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (75 loc) · 2.13 KB
/
build.yaml
File metadata and controls
86 lines (75 loc) · 2.13 KB
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
77
78
79
80
81
82
83
84
85
86
name: Build
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
jobs:
build_wheels:
name: Build wheels for ${{ matrix.platform_id }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
include:
- os: ubuntu-latest
platform_id: manylinux_x86_64
- os: macos-latest
platform_id: macosx
- os: windows-latest
platform_id: win_amd64
steps:
- uses: actions/checkout@v4
- name: Set up MSVC environment (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Build wheels
uses: pypa/cibuildwheel@v2.23.3
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS: ${{ runner.os == 'macOS' && 'universal2' || 'auto64' }}
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.platform_id }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.13'
- run: python -m pip install build
- name: Build sdist
run: python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
upload_pypi:
needs: [ build_sdist, build_wheels ]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
id-token: write
steps:
- name: Download all distribution files
uses: actions/download-artifact@v4
with:
pattern: cibw-*
path: dist/
merge-multiple: true
- name: List files in dist
run: ls -lR dist/
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1