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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
|
---
name: CI
on:
push:
branches:
- 'master'
release:
types:
- published
pull_request:
branches:
- '*'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
wheels:
name: Build wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CIBW_SKIP: pp* *-win32 cp38-* cp39-* cp314t-win*
CIBW_TEST_REQUIRES:
CIBW_TEST_COMMAND: 'python -c "import laszip"'
# we are copying the shared libraries ourselves so skip magical copy
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
MACOSX_DEPLOYMENT_TARGET: 11.0
CIBW_BUILD_VERBOSITY_MACOS: 3
# CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64"
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: ""
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.12'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==3.3.0
- uses: ilammy/msvc-dev-cmd@v1
if: startsWith(matrix.os, 'windows')
- name: Build wheels
run: |
python3 -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-whl
path: wheelhouse/*.whl
wheels_aarch64:
name: Build wheel on aarch64 for ${{ matrix.python_tag }}
runs-on: ubuntu-latest
strategy:
matrix:
python_tag: [ "cp310", "cp311", "cp312", "cp313", "cp314" ]
env:
CIBW_ARCHS_LINUX: aarch64
CIBW_BUILD: ${{matrix.python_tag}}-*
CIBW_TEST_REQUIRES: pytest numpy
CIBW_TEST_COMMAND: "python -c 'import laszip'"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.11'
- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==3.3.0
- uses: docker/setup-qemu-action@v2
name: Set up QEMU
- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: aarch64-${{matrix.python_tag}}-whl
path: wheelhouse/*.whl
pypi-publish:
needs: [wheels, wheels_aarch64]
name: Gather wheels and publish release to PyPI
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/project/laszip/
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.12'
- name: Install dependencies
shell: bash -l {0}
run: |
python -m pip install build pipx twine
pipx run build --sdist
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist
- name: Display structure of downloaded files
run: ls -R
working-directory: dist
- name: Unpack
shell: bash -l {0}
working-directory: dist
run: |
for f in *whl
do
cd "$f"
cp *.whl ..
cd ..
done;
rm -rf *\-whl
ls -al
- name: Publish package distributions to PyPI
if: github.event_name == 'release' && github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@release/v1
|