Merge pull request #590 from nyx-space/position-device-frame-87512637… #847
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
| # This file is autogenerated by maturin v1.13.3 | |
| # To update, run | |
| # | |
| # maturin generate-ci -o ../.github/workflows/python.yml github | |
| # | |
| name: Python | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - '*' | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| linux: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| target: [x86_64, x86] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| lfs: true | |
| - name: Setup Python on ${{ matrix.target }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.14 | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| env: | |
| RUSTFLAGS: "-C target-cpu=x86-64" | |
| with: | |
| target: ${{ matrix.target }} | |
| args: --release --out dist --find-interpreter | |
| sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
| manylinux: 2_28 | |
| working-directory: nyx-py | |
| before-script-linux: | | |
| # Source: https://github.com/sfackler/rust-openssl/issues/2036#issuecomment-1724324145 | |
| # If we're running on rhel centos, install needed packages. | |
| if command -v yum &> /dev/null; then | |
| echo "CENTOS" | |
| yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic clang gcc gcc-c++ make glibc-devel lld | |
| # If we're running on i686 we need to symlink libatomic | |
| # in order to build openssl with -latomic flag. | |
| if [[ ! -d "/usr/lib64" ]]; then | |
| ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so | |
| fi | |
| else | |
| # If we're running on debian-based system. | |
| echo "DEBIAN LIKE" | |
| apt update -y && apt-get install -y libssl-dev openssl pkg-config clang build-essential glibc-dev lld | |
| fi | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: wheels-linux-${{ matrix.target }} | |
| path: nyx-py/dist | |
| - name: pytest | |
| if: ${{ startsWith(matrix.target, 'x86_64') }} | |
| shell: bash | |
| env: | |
| PYTHONFAULTHANDLER: "1" | |
| RUST_BACKTRACE: "full" | |
| run: | | |
| ulimit -c unlimited | |
| set +e | |
| pip debug --verbose | |
| pip install nyx_space --find-links nyx-py/dist --force-reinstall | |
| pip install pytest | |
| pip install -r nyx-py/tests/requirements.txt | |
| python -c "import nyx_space; print('Module initialized successfully.')" | |
| cd nyx-py && pytest | |
| windows: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| target: [x64, x86] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.14 | |
| architecture: ${{ matrix.target }} | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.target }} | |
| args: --release --out dist --find-interpreter | |
| sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
| working-directory: nyx-py | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: wheels-windows-${{ matrix.target }} | |
| path: nyx-py/dist | |
| macos: | |
| runs-on: ${{ matrix.platform.runner }} | |
| strategy: | |
| matrix: | |
| platform: | |
| - runner: macos-15-intel | |
| target: x86_64 | |
| - runner: macos-latest | |
| target: aarch64 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.14 | |
| - name: Remove cargo config # https://github.com/briansmith/ring/discussions/2528#discussioncomment-13255568 | |
| run: rm -f .cargo/config.toml | |
| - name: Build wheels | |
| uses: PyO3/maturin-action@v1 | |
| with: | |
| target: ${{ matrix.platform.target }} | |
| args: --release --out dist --find-interpreter | |
| sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} | |
| working-directory: nyx-py | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: wheels-macos-${{ matrix.platform.target }} | |
| path: nyx-py/dist | |
| # Nyx does NOT provide the source for manual compilation on unavailable platforms on purpose. | |
| # sdist: | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: actions/checkout@v6 | |
| # - name: Build sdist | |
| # uses: PyO3/maturin-action@v1 | |
| # with: | |
| # command: sdist | |
| # args: --out dist | |
| # - name: Upload sdist | |
| # uses: actions/upload-artifact@v7 | |
| # with: | |
| # name: wheels-sdist | |
| # path: dist | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} | |
| needs: [linux, windows, macos] | |
| permissions: | |
| # Use to sign the release artifacts | |
| id-token: write | |
| # Used to upload release artifacts | |
| contents: write | |
| # Used to generate artifact attestation | |
| attestations: write | |
| steps: | |
| - uses: actions/download-artifact@v7 | |
| - name: Generate artifact attestation | |
| uses: actions/attest@v4 | |
| with: | |
| subject-path: 'wheels-*/*' | |
| - name: Install uv | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Publish to PyPI | |
| if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
| run: uv publish 'wheels-*/*' | |
| env: | |
| UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }} |