forked from JacobCallahan/ssh2-python
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (92 loc) · 2.9 KB
/
test_build.yml
File metadata and controls
109 lines (92 loc) · 2.9 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Test Builds
on:
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- "*.md"
- "examples/**"
- "doc/**"
jobs:
build_sdist:
name: Build sdist
runs-on: ubuntu-latest
outputs:
sdist_file: ${{ steps.save-path.outputs.sdist_name }}
steps:
- name: Checkout ssh2-python
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build sdist
run: |
python -m pip install build
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
name: sdist
path: ./dist/*
- name: Sanity check sdist files
run: |
ls ./dist
- name: Output sdist name
id: save-path
shell: bash -el {0}
run: echo "sdist_name=$(ls ./dist)" >> "$GITHUB_OUTPUT"
build_wheels:
needs: build_sdist
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# macos-13 is an intel runner, macos-14 is an arm runner
# windows-latest is currently not working
os: [ubuntu-latest, macos-13, macos-14]
steps:
- name: Checkout ssh2-python
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download sdist
uses: actions/download-artifact@v4
with:
name: sdist
path: ./dist
- name: Output sdist name
id: save-path
shell: bash -el {0}
run: echo "sdist_name=$(ls ./dist)" >> "$GITHUB_ENV"
- name: Unzip sdist (macOS)
if: startsWith(matrix.os, 'macos')
run: |
tar -xzf ./dist/${{ env.sdist_name }} -C ./dist
- name: Output sdist name (macOS)
id: save-path2
shell: bash -el {0}
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"
- name: Set up Python ${{ matrix.cibw_python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.cibw_python }}
- name: Install python dependencies
run: |
pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Build normal wheels
uses: pypa/cibuildwheel@v2.17
with:
package-dir: ./dist/${{ startsWith(matrix.os, 'macos') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
env:
CIBW_SKIP: "*musllinux*"
CIBW_BUILD: "cp310-* cp311-* cp312-*"
CIBW_PRERELEASE_PYTHONS: True
CIBW_BEFORE_ALL_LINUX: "yum install -y cmake openssh-server openssl-devel"
CIBW_BEFORE_ALL_MACOS: "brew install cmake libssh2"
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl