Skip to content

Update cibuildwheel.yml #234

Update cibuildwheel.yml

Update cibuildwheel.yml #234

Workflow file for this run

name: Build and upload to PyPI
on:
pull_request:
release:
types:
- published
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS: "auto64"
CIBW_SKIP: "pp* cp36-* cp37-* *musllinux* cp38-macosx_arm64"
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest --pyargs nlsam --verbose
CIBW_TEST_COMMAND_LINUX: >
pytest --pyargs nlsam --verbose &&
cd {package}/example &&
chmod +x {package}/nlsam/tests/test_scripts1.sh &&
bash {package}/nlsam/tests/test_scripts1.sh &&
chmod +x {package}/nlsam/tests/test_scripts2.sh &&
bash {package}/nlsam/tests/test_scripts2.sh
- uses: actions/upload-artifact@v4
with:
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
- name: Build sdist
run: |
python -m pip install build
python -m build --sdist
- uses: actions/upload-artifact@v4
with:
path: dist/*.tar.gz
build_pyinstaller:
name: Build pyinstaller on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.10'
- name: Get pyinstaller
shell: bash
run: |
python -m pip install pyinstaller dask[distributed]
python -m pip install .
path=$(python -c "import distributed; print(distributed.__path__[0]);")
echo "version=v$(python -c "from importlib.metadata import version; print(version('nlsam'));")" >> $GITHUB_ENV
if [ "$RUNNER_OS" == "Windows" ]; then
pyinstaller ./scripts/nlsam_denoising -F --clean --add-data "${path};.\\distributed\\" --noupx
else
pyinstaller ./scripts/nlsam_denoising -F --clean --add-data ${path}:./distributed/ --noupx
fi
- uses: actions/upload-artifact@v4
with:
name: nlsam_${{ env.version }}_${{ runner.os }}
path: ./dist/nlsam_denoising*
- uses: actions/upload-artifact@v4
with:
name: nlsam_${{ env.version }}_${{ runner.os }}
path: |
CHANGELOG.md
README.md
LICENSE
example/*