-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (85 loc) · 2.63 KB
/
Copy pathpython-publish.yml
File metadata and controls
95 lines (85 loc) · 2.63 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
87
88
89
90
91
92
93
94
95
name: Build and Publish Python Wheels
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build-wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Build wheels (Linux)
if: matrix.os == 'ubuntu-latest'
uses: PyO3/maturin-action@v1
with:
maturin-version: latest
command: build
args: "--release -o dist --features vendored-openssl --interpreter 3.10 3.11 3.12 3.13 --manifest-path easypqp-py/Cargo.toml"
container: quay.io/pypa/manylinux_2_28_x86_64:latest
before-script-linux: |
dnf install -y perl-core
- name: Build wheels (Windows/macOS)
if: matrix.os != 'ubuntu-latest'
uses: PyO3/maturin-action@v1
with:
maturin-version: latest
command: build
args: "--release -o dist --interpreter 3.10 3.11 3.12 3.13 --manifest-path easypqp-py/Cargo.toml"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: dist/*.whl
build-sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install maturin
run: pip install maturin
- name: Build sdist
run: maturin sdist --manifest-path easypqp-py/Cargo.toml --out dist
- name: Upload sdist artifact
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
publish:
name: Publish to PyPI
runs-on: ubuntu-latest
needs: [build-wheels, build-sdist]
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*
merge-multiple: true
path: dist
- uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: "--skip-existing dist/*"