-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (52 loc) · 1.44 KB
/
Copy pathpython.yml
File metadata and controls
58 lines (52 loc) · 1.44 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
name: Build & publish Python wheels
on:
push:
branches: [main]
tags:
- v*
pull_request:
branches: [main]
paths:
- src/**
- pyproject.toml
- Cargo.toml
- Cargo.lock
- .github/workflows/python.yml
- .github/workflows/python-build.yml
- test_ridal_interface.py
workflow_dispatch:
jobs:
build-pr:
name: Build PR (ubuntu / python 3.12)
if: github.event_name == 'pull_request'
uses: ./.github/workflows/python-build.yml
with:
os: ubuntu-latest
python-version: '3.12'
build-all:
name: Build all platforms
if: github.event_name != 'pull_request'
uses: ./.github/workflows/python-build.yml
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
python-version: ['3.10', '3.11', '3.12', '3.13']
publish:
name: Publish to PyPI
needs: build-all
runs-on: ubuntu-latest
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch'
steps:
- name: Download all wheels
uses: actions/download-artifact@v4
with:
path: wheels
- name: Publish to PyPI
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
pip install maturin
maturin publish --features python --no-default-features --skip-existing --glob "wheels/*.whl"