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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
name: Publish Python Packages
on:
release:
types:
- published
workflow_dispatch:
inputs:
target:
description: "Where to publish the packages"
required: true
default: "testpypi"
type: choice
options:
- testpypi
- pypi
jobs:
build-wheels:
name: Build ${{ matrix.package }} wheels on ${{ matrix.os }} (${{ matrix.target }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- package: mq-bridge-py-basic
pyproject: pyproject-basic.toml
runner: ubuntu-latest
os: linux
target: x86_64
args: --release --out dist --find-interpreter --no-default-features
- package: mq-bridge-py-basic
# Build the aarch64 basic wheel on a native arm64 runner to avoid
# ring/aws-lc-sys cross-toolchain issues in manylinux containers.
# If maturin's manylinux:auto still selects a container that
# reintroduces those issues, pin manylinux to a specific version.
pyproject: pyproject-basic.toml
runner: ubuntu-24.04-arm
os: linux
target: aarch64
args: --release --out dist --find-interpreter --no-default-features
- package: mq-bridge-py-basic
pyproject: pyproject-basic.toml
runner: macos-15-intel
os: macos
target: x86_64
args: --release --out dist --find-interpreter --no-default-features
- package: mq-bridge-py-basic
pyproject: pyproject-basic.toml
runner: macos-latest
os: macos
target: aarch64
args: --release --out dist --find-interpreter --no-default-features
- package: mq-bridge-py-basic
pyproject: pyproject-basic.toml
runner: windows-latest
os: windows
target: x86_64
args: --release --out dist --find-interpreter --no-default-features
- package: mq-bridge-py
pyproject: pyproject.toml
runner: ubuntu-latest
os: linux
target: x86_64
args: --release --out dist --find-interpreter
- package: mq-bridge-py
# Build the full wheel for aarch64 on a NATIVE arm64 runner rather
# than cross-compiling from x86_64. The `full` feature pulls in
# aws-lc-sys (BoringSSL C), which has no pre-built artifact and
# fails to cross-compile in the manylinux container; building
# natively makes it a plain native C compile. (The basic wheel uses
# rustls-ring, which cross-compiles fine, so it stays on ubuntu-latest.)
pyproject: pyproject.toml
runner: ubuntu-24.04-arm
os: linux
target: aarch64
args: --release --out dist --find-interpreter
- package: mq-bridge-py
pyproject: pyproject.toml
runner: macos-15-intel
os: macos
target: x86_64
args: --release --out dist --find-interpreter
- package: mq-bridge-py
pyproject: pyproject.toml
runner: macos-latest
os: macos
target: aarch64
args: --release --out dist --find-interpreter
- package: mq-bridge-py
pyproject: pyproject.toml
runner: windows-latest
os: windows
target: x86_64
args: --release --out dist --find-interpreter
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Select package metadata
if: matrix.pyproject != 'pyproject.toml'
working-directory: python/mq-bridge-py
shell: bash
run: cp "${{ matrix.pyproject }}" pyproject.toml
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Build wheels
uses: PyO3/maturin-action@v1
env:
# Work around intermittent "HTTP2 framing layer" curl errors when
# cargo downloads crates inside the manylinux container.
CARGO_HTTP_MULTIPLEXING: "false"
CARGO_NET_RETRY: "5"
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
with:
working-directory: python/mq-bridge-py
command: build
target: ${{ matrix.target }}
args: ${{ matrix.args }}
sccache: "true"
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.package }}-${{ matrix.os }}-${{ matrix.target }}
path: python/mq-bridge-py/dist
build-sdists:
name: Build ${{ matrix.package }} sdist
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- package: mq-bridge-py-basic
pyproject: pyproject-basic.toml
- package: mq-bridge-py
pyproject: pyproject.toml
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Select package metadata
if: matrix.pyproject != 'pyproject.toml'
working-directory: python/mq-bridge-py
run: cp "${{ matrix.pyproject }}" pyproject.toml
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
working-directory: python/mq-bridge-py
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: sdist-${{ matrix.package }}
path: python/mq-bridge-py/dist
publish:
name: Publish to ${{ github.event_name == 'release' && 'PyPI' || inputs.target }}
runs-on: ubuntu-latest
needs:
permissions:
contents: read
id-token: write
environment:
name: ${{ github.event_name == 'release' && 'pypi' || inputs.target }}
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: List distribution files
run: ls -lh dist/
- name: Check package metadata
run: |
pip install twine
twine check dist/*
- name: Publish to TestPyPI
if: github.event_name == 'workflow_dispatch' && inputs.target == 'testpypi'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: dist/
- name: Publish to PyPI
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.target == 'pypi')
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/