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
name: Python wheels
on:
push:
tags:
# Hand-trigger only — wheels do not need to rebuild on every push to main.
# Use the Actions UI's "Run workflow" button to invoke manually.
workflow_dispatch:
# Cancel queued/running wheel jobs if a newer tag supersedes them.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
target:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
# Python 3.8 + 3.9 dropped: both are EOL and rarely used in modern
# vision stacks. Trims the per-platform wheel count from 6 → 4.
args: --release --out dist --manifest-path python/Cargo.toml --interpreter 3.10 3.11 3.12 3.13
sccache: "true"
manylinux: 2_28
- uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.target }}
path: dist
retention-days: 14
macos:
runs-on: macos-latest
# Intel macOS dropped: macos-latest is arm64 only since 2024 (Intel runs
# would be billed at 10× and Apple has EOL'd Intel Macs). Users on Intel
# Macs can install via Rosetta or `pip install --no-binary`.
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: aarch64
args: --release --out dist --manifest-path python/Cargo.toml
sccache: "true"
- uses: actions/upload-artifact@v4
with:
name: wheels-macos-aarch64
path: dist
retention-days: 14
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: x64
args: --release --out dist --manifest-path python/Cargo.toml
sccache: "true"
- uses: actions/upload-artifact@v4
with:
name: wheels-windows-x64
path: dist
retention-days: 14
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist --manifest-path python/Cargo.toml
- uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist
retention-days: 14
# ─────────────────────────────────────────────────────────────────────────
# PyPI publish — disabled by default. To enable:
# 1. Create a PyPI account: https://pypi.org/account/register/
# 2. Reserve the project name "vision-squeezer" on PyPI (push a first
# manual release, or contact PyPI support if the name is taken).
# 3. Add a Trusted Publisher (no API token needed):
# https://pypi.org/manage/account/publishing/
# Owner: eralpozcan
# Repo: vision-squeezer
# Workflow filename: python.yml
# Environment name: pypi
# 4. Create a GitHub environment named "pypi" with no protection rules.
# 5. Uncomment the job below.
#
# release:
# name: Publish to PyPI
# runs-on: ubuntu-latest
# if: startsWith(github.ref, 'refs/tags/v')
# needs: [linux, macos, windows, sdist]
# environment:
# name: pypi
# url: https://pypi.org/p/vision-squeezer
# permissions:
# id-token: write
# steps:
# - uses: actions/download-artifact@v4
# with:
# pattern: wheels-*
# merge-multiple: true
# path: dist
# - name: Publish
# uses: PyO3/maturin-action@v1
# with:
# command: upload
# args: --skip-existing dist/*