Update the CI workflow #37
This file contains hidden or 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: Build | |
| on: | |
| push: | |
| pull_request: | |
| release: | |
| types: | |
| - published | |
| env: | |
| CIBW_ARCHS_MACOS: x86_64 arm64 | |
| CIBW_ARCHS_LINUX: x86_64 | |
| CIBW_BEFORE_ALL_LINUX: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain=stable --profile=minimal -y | |
| CIBW_ENVIRONMENT_LINUX: 'PATH="$HOME/.cargo/bin:$PATH"' | |
| CIBW_SKIP: cp36-* cp37-* pp* *i686 | |
| jobs: | |
| build_wheels: | |
| name: Build wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - run: python -m pip install cibuildwheel==2.21.3 | |
| - run: echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion | cut -d '.' -f 1-2)" >> $GITHUB_ENV | |
| if: startsWith(matrix.os, 'macos') | |
| - run: | | |
| brew install nasm | |
| python -m cibuildwheel | |
| if: startsWith(matrix.os, 'macos-13') | |
| - run: python -m cibuildwheel | |
| if: startsWith(matrix.os, 'macos-latest') | |
| - run: python -m cibuildwheel | |
| if: startsWith(matrix.os, 'ubuntu-latest') | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: wheelhouse-${{ matrix.os }} | |
| path: ./wheelhouse/*.whl | |
| import_library: | |
| name: Import library on ${{ matrix.os }} with Python ${{ matrix.python }} | |
| runs-on: ${{ matrix.os }} | |
| needs: [build_wheels] | |
| strategy: | |
| matrix: | |
| python: ["3.9", "3.10", "3.11", "3.12", "3.13"] | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: wheelhouse-${{ matrix.os }} | |
| path: wheelhouse | |
| - run: python -m pip install --find-links wheelhouse aedat | |
| - run: python -c 'import aedat' | |
| build_sdist: | |
| name: Build source distribution | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: pipx run build --sdist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/*.tar.gz | |
| upload_pypi: | |
| name: Upload wheels and sidst to PyPI | |
| runs-on: ubuntu-latest | |
| needs: [build_wheels, import_library, build_sdist] | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: wheelhouse | |
| pattern: wheelhouse-* | |
| merge-multiple: true | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist | |
| - run: mv wheelhouse/* dist/ | |
| - uses: pypa/[email protected] | |
| with: | |
| password: ${{ secrets.PYPI_API_TOKEN }} |