From 0d12119d31035207178506b8fc9f21e33a0ffec2 Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Mon, 13 May 2024 20:13:17 -0400 Subject: [PATCH] update github workflow --- .github/workflows/build_library.yml | 97 +++++++++++------------------ 1 file changed, 36 insertions(+), 61 deletions(-) diff --git a/.github/workflows/build_library.yml b/.github/workflows/build_library.yml index 31f85bf4a49..575a740e0bf 100644 --- a/.github/workflows/build_library.yml +++ b/.github/workflows/build_library.yml @@ -10,99 +10,74 @@ env: jobs: linux: - timeout-minutes: 30 + runs-on: ubuntu-latest strategy: - fail-fast: false matrix: - build-arch: - - i686 - - x86_64 - - aarch64 - - name: Python Linux ${{ matrix.build-arch }} - runs-on: ubuntu-latest - + target: [x86_64, aarch64] steps: - uses: actions/checkout@v4 + - run: rustup toolchain install stable --profile minimal --no-self-update + - uses: actions/setup-python@v5 with: - submodules: recursive + python-version: '3.10' - - if: matrix.build-arch == 'aarch64' - uses: docker/setup-qemu-action@v3 + - name: Build wheels + uses: PyO3/maturin-action@v1 + working-directory: py with: - platforms: arm64 - - - name: Build in Docker - run: scripts/docker-manylinux.sh - env: - TARGET: ${{ matrix.build-arch }} + target: ${{ matrix.target }} + args: --release --out dist --find-interpreter + sccache: "true" + manylinux: auto - - uses: actions/upload-artifact@v3 + - name: Upload wheels + uses: actions/upload-artifact@v3 + working-directory: py with: name: ${{ github.sha }} - path: py/dist/* + path: dist macos: + runs-on: macos-latest strategy: - fail-fast: false matrix: - include: - - target: x86_64-apple-darwin - py-platform: macosx-10_15_x86_64 - - target: aarch64-apple-darwin - py-platform: macosx-11_0_arm64 - - name: Python macOS ${{ matrix.py-platform }} - runs-on: macos-11 - + target: [x86_64, aarch64] steps: - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Install Rust Toolchain - run: | - rustup set profile minimal - rustup toolchain install stable - rustup override set stable - rustup target add --toolchain stable ${{ matrix.target }} - + - run: rustup toolchain install stable --profile minimal --no-self-update - uses: actions/setup-python@v5 with: python-version: '3.10' - - name: Build Wheel - run: | - pip install wheel - python setup.py bdist_wheel -p ${{ matrix.py-platform }} + - name: Build wheels + uses: PyO3/maturin-action@v1 working-directory: py - env: - # consumed by cargo and setup.py to obtain the target dir - CARGO_BUILD_TARGET: ${{ matrix.target }} + with: + target: ${{ matrix.target }} + args: --release --out dist --find-interpreter + sccache: "true" - - uses: actions/upload-artifact@v3 + - name: Upload wheels + uses: actions/upload-artifact@v3 with: name: ${{ github.sha }} - path: py/dist/* + path: dist sdist: - name: Python sdist runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - with: - submodules: recursive - - - uses: actions/setup-python@v5 - with: - python-version: '3.10' - name: Build sdist - run: python setup.py sdist --format=zip + uses: PyO3/maturin-action@v1 working-directory: py + with: + command: sdist + args: --out dist - - uses: actions/upload-artifact@v3 + - name: Upload sdist + uses: actions/upload-artifact@v3 + working-directory: py with: name: ${{ github.sha }} - path: py/dist/* + path: dist