Skip to content

Pulled latest brambox v5.0.0 #83

Pulled latest brambox v5.0.0

Pulled latest brambox v5.0.0 #83

Workflow file for this run

name: Build
on: [push, pull_request]
env:
PYPI_TEST_DEV: 4 # Increase number when you need to push the same version to pypitest (because cibuildwheel debugging)
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_PYPY_I686_IMAGE: manylinux2014
jobs:
######################################
# JOB
# Build binary wheels
######################################
build_wheels:
name: Build wheel ${{ matrix.os }} - ${{ matrix.python }} - ${{ matrix.architecture }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
architecture: [auto, aarch64]
python: [37, 38, 39, 310, 311, 312]
exclude:
- os: windows-latest
architecture: aarch64
- os: macos-13
architecture: aarch64
- os: macos-14
architecture: aarch64
- os: macos-14
python: 37
steps:
- name: Set up QEMU
if: contains(fromJson('["aarch64", "ppc64le", "s390x"]'), matrix.architecture)
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Get submodule tags
run: |
git submodule init
git submodule update --recursive
git submodule foreach --recursive 'git fetch --tags'
git submodule update --recursive
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.8
cache: pip
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.15.0
- name: Build wheels for CPython ${{ matrix.python }}
env:
CIBW_BUILD: ${{ format('cp{0}-*', matrix.python) }}
CIBW_ARCHS: ${{ matrix.architecture }}
CIBW_SKIP: "*-musllinux*"
CIBW_ENVIRONMENT: "${{ (github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')) && 'PYPIBUILD=1' || format('PYPIBUILD=1 PYPITEST={0}', env.PYPI_TEST_DEV) }}"
CIBW_BEFORE_BUILD: ${{ format('bash scripts/compile.sh {{package}} {0} {1} {2}', matrix.os, matrix.python, matrix.architecture) }}
run: |
python -m cibuildwheel --output-dir wheelhouse brambox/
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: ${{format('build-artifact--{0}-{1}-{2}', matrix.os, matrix.python, matrix.architecture)}}
path: wheelhouse/*.whl
######################################
# JOB
# Build linux source distribution
######################################
build_sdist:
name: Build source
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Get submodule tags
run: |
git submodule init
git submodule update --recursive
git submodule foreach --recursive 'git fetch --tags'
git submodule update --recursive
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.7
cache: pip
- name: Build sdist
env:
PYPIBUILD: 1
PYPITEST: "${{ (github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')) && '0' || env.PYPI_TEST_DEV }}"
run: |
python -m pip install "numpy==1.14.6" "cython~=3.0.0" tomli build
cd brambox
python -m build --sdist
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifact--source
path: brambox/dist/*.tar.gz
######################################
# JOB
# Upload Test PyPI
######################################
upload_test_pypi:
name: Upload test PyPI servers
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/heads/master')
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist
pattern: build-artifact--*
merge-multiple: true
- name: Upload PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TEST_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
verbose: true
######################################
# JOB
# Upload PyPI
######################################
upload_pypi:
name: Upload PyPI servers
runs-on: ubuntu-latest
needs: [build_wheels, build_sdist]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist
pattern: build-artifact--*
merge-multiple: true
- name: Upload PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true
######################################
# JOB
# Test PyPi install
######################################
test_pypi:
name: Test wheel ${{ matrix.os }} - ${{ matrix.python }} - NumPy ${{ matrix.numpy }}
runs-on: ${{ matrix.os }}
needs: [upload_test_pypi]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
numpy: ["<2.0.0", ">=2.0.0"]
exclude:
- os: macos-14
python: "3.7"
- python: "3.7"
numpy: ">=2.0.0"
- python: "3.8"
numpy: ">=2.0.0"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
- name: Install numpy
run: |
pip install "numpy${{ matrix.numpy }}"
- name: Install package
run: |
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple --pre brambox
- name: Run package
run: |
python -c "import brambox as bb; print(f'Brambox Version {bb.__version__}')"