sortednp #31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |