-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (88 loc) · 2.94 KB
/
sortednp.yaml
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
name: sortednp
on:
workflow_dispatch:
inputs:
sortednpVersion:
description: "sortednp version"
required: true
default: "0.5.0"
numpyVersion:
description: "numpy version"
required: true
default: "2.0"
cibwVersion:
description: "cibuildwheel version"
default: "2.12.3"
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CIBW_BUILD: "cp39-* cp310-* cp311-* cp312-*"
SORTEDNP_VERSION: ${{ inputs.sortednpVersion }}
NUMPY_VERSION: ${{ inputs.numpyVersion }}
CIBW_VERSION: ${{ inputs.cibwVersion }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- name: Download sortednp
run: |
git clone https://gitlab.sauerburger.com/frank/sortednp.git \
--branch "release-${SORTEDNP_VERSION}" --single-branch
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Patch Numpy version
if: ${{ matrix.os == 'ubuntu-latest'}}
run: |
cd sortednp
sed -i 's/.*numpy>.*/ install_requires=["numpy>=${NUMPY_VERSION}"],/g' setup.py
cat setup.py
- name: Patch to include Python3.12 in MacOS
if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14'}}
run: |
cd sortednp
sed -i '' 's/.*numpy>.*/ install_requires=["numpy>=${NUMPY_VERSION}"],/g' setup.py
- name: Patch to include Python3.12 in Windows
if: ${{ matrix.os == 'windows-latest'}}
run: |
cd sortednp
powershell -command "(Get-Content setup.py) -replace '.*numpy>.*', ' install_requires=[\"numpy>=$env:NUMPY_VERSION\"],' | Set-Content setup.py"
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==${CIBW_VERSION}
- name: Build wheels
env:
CIBW_SKIP: "*-musllinux*"
CIBW_ARCHS_MACOS: "universal2"
CIBW_ARCHS_LINUX: "x86_64"
CIBW_ARCHS_WINDOWS: "AMD64"
run: |
cd sortednp
CIBW_BEFORE_BUILD="pip install numpy==${NUMPY_VERSION}" \
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./sortednp/wheelhouse/*.whl
publish:
name: Publish wheels to pypi.scm.io
needs: [build_wheels]
runs-on: ubuntu-latest
steps:
- name: Get wheels
uses: actions/download-artifact@v3
with:
name: wheels
path: dist
- name: Publish to pypy.scm.io
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: ${{ secrets.PYPI_SCM_USERNAME }}
password: ${{ secrets.PYPI_SCM_PASSWORD }}
repository-url: https://pypi.scm.io/simple/
skip-existing: true