Skip to content

Commit ef62224

Browse files
authored
Update CI workflows for building wheels and publishing (#8)
* Updated workflow + test version * Reverted to next beta release version * Added workflow to build and publish
1 parent 0f27505 commit ef62224

3 files changed

Lines changed: 112 additions & 10 deletions

File tree

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Build and Publish
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "v*"
8+
9+
jobs:
10+
build_wheels:
11+
name: Build wheels on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
17+
env:
18+
# ---- Linux ----
19+
# Build manylinux + musllinux wheels
20+
CIBW_ARCHS_LINUX: "x86_64"
21+
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
22+
CIBW_MUSLLINUX_X86_64_IMAGE: "musllinux_1_2"
23+
24+
# ---- macOS ----
25+
# Build Intel, Apple Silicon, and universal2 wheels
26+
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2"
27+
28+
# ---- Windows ----
29+
# Build both 32-bit and 64-bit wheels
30+
CIBW_ARCHS_WINDOWS: "AMD64 x86"
31+
32+
# ---- General settings ----
33+
# Build wheels for CPython 3.11–3.13
34+
CIBW_BUILD: "cp311-* cp312-* cp313-*"
35+
36+
# If needed, skip PyPy or unsupported combos
37+
CIBW_SKIP: "pp* *-manylinux_i686"
38+
39+
# Output
40+
CIBW_OUTPUT_DIR: "wheelhouse"
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- name: Install cibuildwheel
46+
run: pip install cibuildwheel==2.22.0
47+
48+
- name: Build wheels
49+
run: cibuildwheel
50+
51+
- name: Upload wheels as artifacts
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: wheels-${{ matrix.os }}
55+
path: wheelhouse/*.whl
56+
57+
build_sdist:
58+
name: Build sdist
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- name: Build sdist
64+
run: |
65+
pip install build
66+
python -m build --sdist
67+
68+
- uses: actions/upload-artifact@v4
69+
with:
70+
name: sdist
71+
path: dist/*.tar.gz
72+
73+
publish:
74+
name: Publish to PyPI
75+
needs: [build_wheels, build_sdist]
76+
runs-on: ubuntu-latest
77+
steps:
78+
- uses: actions/download-artifact@v4
79+
80+
- name: Install Twine
81+
run: pip install twine
82+
83+
- name: Publish to PyPI
84+
run: |
85+
twine upload wheels-*/* sdist/*
86+
env:
87+
TWINE_USERNAME: "__token__"
88+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/build_wheels.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ name: Build wheels
22

33
on:
44
workflow_dispatch:
5-
push:
6-
tags:
7-
- "v*"
85

96
jobs:
107
build_wheels:
@@ -15,21 +12,38 @@ jobs:
1512
os: [ubuntu-latest, macos-latest, windows-latest]
1613

1714
env:
15+
# ---- Linux ----
16+
# Build manylinux + musllinux wheels
1817
CIBW_ARCHS_LINUX: "x86_64"
18+
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
19+
CIBW_MUSLLINUX_X86_64_IMAGE: "musllinux_1_2"
20+
21+
# ---- macOS ----
22+
# Build Intel, Apple Silicon, and universal2 wheels
23+
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2"
24+
25+
# ---- Windows ----
26+
# Build both 32-bit and 64-bit wheels
27+
CIBW_ARCHS_WINDOWS: "AMD64 x86"
28+
29+
# ---- General settings ----
30+
# Build wheels for CPython 3.11–3.13
31+
CIBW_BUILD: "cp311-* cp312-* cp313-*"
32+
33+
# If needed, skip PyPy or unsupported combos
34+
CIBW_SKIP: "pp* *-manylinux_i686"
35+
36+
# Output
37+
CIBW_OUTPUT_DIR: "wheelhouse"
1938

2039
steps:
2140
- uses: actions/checkout@v4
2241

23-
- name: Install Python
24-
uses: actions/setup-python@v5
25-
with:
26-
python-version: "3.12"
27-
2842
- name: Install cibuildwheel
2943
run: pip install cibuildwheel==2.22.0
3044

3145
- name: Build wheels
32-
run: cibuildwheel --output-dir wheelhouse
46+
run: cibuildwheel
3347

3448
- name: Upload wheels as artifacts
3549
uses: actions/upload-artifact@v4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img src=".github/assets/logo.svg" alt="ErrorAlign Logo" width="100%"/>
2+
<img src="https://raw.githubusercontent.com/corticph/error-align/refs/heads/main/.github/assets/logo.svg" alt="ErrorAlign Logo" width="100%"/>
33
</p>
44

55
<p align="center">

0 commit comments

Comments
 (0)