Skip to content

Commit 49a579b

Browse files
committed
Update build matrix
Added in macos-14 and windows-latest Additionally, added a test build action to make sure nothing breaks in a pull request.
1 parent 6ffe812 commit 49a579b

File tree

3 files changed

+115
-11
lines changed

3 files changed

+115
-11
lines changed

.github/workflows/build_and_release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ jobs:
5151
strategy:
5252
fail-fast: false
5353
matrix:
54-
# macos-13 is an intel runner
55-
os: [ubuntu-latest, macos-13]
54+
# macos-13 is an intel runner, macos-14 is an arm runner
55+
# windows-latest is currently not working
56+
os: [ubuntu-latest, macos-13, macos-14]
5657

5758
steps:
5859
- name: Checkout ssh2-python
@@ -92,7 +93,7 @@ jobs:
9293
pip install -r requirements_dev.txt
9394
9495
- name: Build normal wheels
95-
uses: pypa/cibuildwheel@v2.16.5
96+
uses: pypa/cibuildwheel@v2.17
9697
with:
9798
package-dir: ./dist/${{ startsWith(matrix.os, 'macos') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
9899
env:

.github/workflows/test_build.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Test Builds
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
paths-ignore:
7+
- "*.md"
8+
- "examples/**"
9+
- "doc/**"
10+
11+
jobs:
12+
build_sdist:
13+
name: Build sdist
14+
runs-on: ubuntu-latest
15+
outputs:
16+
sdist_file: ${{ steps.save-path.outputs.sdist_name }}
17+
steps:
18+
- name: Checkout ssh2-python
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: '3.10'
27+
28+
- name: Build sdist
29+
run: |
30+
python -m pip install build
31+
python -m build --sdist
32+
33+
- uses: actions/upload-artifact@v4
34+
with:
35+
name: sdist
36+
path: ./dist/*
37+
38+
- name: Sanity check sdist files
39+
run: |
40+
ls ./dist
41+
42+
- name: Output sdist name
43+
id: save-path
44+
shell: bash -el {0}
45+
run: echo "sdist_name=$(ls ./dist)" >> "$GITHUB_OUTPUT"
46+
47+
build_wheels:
48+
needs: build_sdist
49+
name: Build wheels on ${{ matrix.os }}
50+
runs-on: ${{ matrix.os }}
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
# macos-13 is an intel runner, macos-14 is an arm runner
55+
# windows-latest is currently not working
56+
os: [ubuntu-latest, macos-13, macos-14]
57+
58+
steps:
59+
- name: Checkout ssh2-python
60+
uses: actions/checkout@v4
61+
with:
62+
fetch-depth: 0
63+
64+
- name: Download sdist
65+
uses: actions/download-artifact@v4
66+
with:
67+
name: sdist
68+
path: ./dist
69+
70+
- name: Output sdist name
71+
id: save-path
72+
shell: bash -el {0}
73+
run: echo "sdist_name=$(ls ./dist)" >> "$GITHUB_ENV"
74+
75+
- name: Unzip sdist (macOS)
76+
if: startsWith(matrix.os, 'macos')
77+
run: |
78+
tar -xzf ./dist/${{ env.sdist_name }} -C ./dist
79+
80+
- name: Output sdist name (macOS)
81+
id: save-path2
82+
shell: bash -el {0}
83+
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"
84+
85+
- name: Set up Python ${{ matrix.cibw_python }}
86+
uses: actions/setup-python@v5
87+
with:
88+
python-version: ${{ matrix.cibw_python }}
89+
90+
- name: Install python dependencies
91+
run: |
92+
pip install --upgrade pip
93+
pip install -r requirements_dev.txt
94+
95+
- name: Build normal wheels
96+
uses: pypa/cibuildwheel@v2.17
97+
with:
98+
package-dir: ./dist/${{ startsWith(matrix.os, 'macos') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
99+
env:
100+
CIBW_SKIP: "*musllinux*"
101+
CIBW_BUILD: "cp310-* cp311-* cp312-*"
102+
CIBW_PRERELEASE_PYTHONS: True
103+
CIBW_BEFORE_ALL_LINUX: "yum install -y cmake openssh-server openssl-devel"
104+
CIBW_BEFORE_ALL_MACOS: "brew install cmake libssh2"
105+
106+
- uses: actions/upload-artifact@v4
107+
with:
108+
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
109+
path: ./wheelhouse/*.whl

setup.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from _setup_libssh2 import build_ssh2
77

8-
# import versioneer
98
from setuptools import setup, find_packages
109

1110
cpython = platform.python_implementation() == 'CPython'
@@ -41,7 +40,6 @@
4140
'zlibstatic',
4241
]
4342

44-
# _comp_args = ["-ggdb"]
4543
_fwd_default = 0
4644
_comp_args = ["-O2"] if not ON_WINDOWS else None
4745

@@ -87,14 +85,9 @@
8785
'msvc*.dll', 'vcruntime*.dll',
8886
])
8987

90-
# cmdclass = versioneer.get_cmdclass()
91-
# if USING_CYTHON:
92-
# cmdclass['build_ext'] = build_ext
93-
9488
setup(
9589
name='ssh2-python312',
96-
version="0.1.0",
97-
# cmdclass=cmdclass,
90+
version="0.1.1",
9891
url='https://github.com/jacobcallahan/ssh2-python',
9992
license='LGPLv2',
10093
author='Panos Kittenis',
@@ -127,6 +120,7 @@
127120
'Operating System :: POSIX :: Linux',
128121
'Operating System :: POSIX :: BSD',
129122
'Operating System :: MacOS :: MacOS X',
123+
# 'Operating System :: Microsoft :: Windows',
130124
],
131125
ext_modules=cythonize(extensions, **cython_args) if USING_CYTHON else extensions,
132126
package_data=package_data,

0 commit comments

Comments
 (0)