diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 3c9f054..5f187d4 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -2,7 +2,11 @@ name: Build Python Wheels on: pull_request: - workflow_dispatch: + branches: + - main + push: + branches: + - main permissions: contents: read diff --git a/.github/workflows/checks_rust.yml b/.github/workflows/checks_rust.yml index 5cacfda..6bf2517 100644 --- a/.github/workflows/checks_rust.yml +++ b/.github/workflows/checks_rust.yml @@ -2,7 +2,11 @@ name: Rust Checks on: pull_request: - workflow_dispatch: + branches: + - main + push: + branches: + - main permissions: contents: read diff --git a/.github/workflows/python_checks.yml b/.github/workflows/python_checks.yml index f3b6d3a..b3d20f2 100644 --- a/.github/workflows/python_checks.yml +++ b/.github/workflows/python_checks.yml @@ -2,7 +2,11 @@ name: Python Checks on: pull_request: - workflow_dispatch: + branches: + - main + push: + branches: + - main permissions: contents: read diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b293f85..575f682 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,26 +8,86 @@ permissions: jobs: build: + name: Build wheels (${{ matrix.platform.id }}) runs-on: ${{ matrix.platform.runner }} strategy: + fail-fast: false matrix: platform: - - runner: ubuntu-22.04 - - runner: ubuntu-22.04-arm - - runner: macos-14 + # manylinux_2_28 x86_64 (cp310-cp313) + - id: manylinux_2_28-x86_64 + runner: ubuntu-22.04 + target: x86_64-unknown-linux-gnu + manylinux: "2_28" + maturin_args: >- + --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi + -i python3.10 -i python3.11 -i python3.12 -i python3.13 + + # manylinux_2_28 aarch64 (cp310-cp313) + - id: manylinux_2_28-aarch64 + runner: ubuntu-22.04 + target: aarch64-unknown-linux-gnu + manylinux: "2_28" + maturin_args: >- + --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi + -i python3.10 -i python3.11 -i python3.12 -i python3.13 + + # macOS arm64 (cp310) + - id: macos-arm64-cp310 + runner: macos-14 + target: aarch64-apple-darwin + python: "3.10" + manylinux: "" + maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python + + # macOS arm64 (cp311) + - id: macos-arm64-cp311 + runner: macos-14 + target: aarch64-apple-darwin + python: "3.11" + manylinux: "" + maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python + + # macOS arm64 (cp312) + - id: macos-arm64-cp312 + runner: macos-14 + target: aarch64-apple-darwin + python: "3.12" + manylinux: "" + maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python + + # macOS arm64 (cp313) + - id: macos-arm64-cp313 + runner: macos-14 + target: aarch64-apple-darwin + python: "3.13" + manylinux: "" + maturin_args: --release --manifest-path booster_sdk_py/Cargo.toml --out dist --compatibility pypi -i python + steps: - uses: actions/checkout@v4 - - uses: prefix-dev/setup-pixi@v0.9.1 + + # Only needed for macOS builds (Linux manylinux builds run inside the container and + # actions/setup-python won't affect those). + - name: Setup Python (macOS only) + if: startsWith(matrix.platform.runner, 'macos') + uses: actions/setup-python@v5 with: - pixi-version: v0.63.2 - environments: "py" + python-version: ${{ matrix.platform.python }} + - name: Build wheels - run: pixi run py-build-wheel + uses: PyO3/maturin-action@v1 + with: + command: build + target: ${{ matrix.platform.target }} + manylinux: ${{ matrix.platform.manylinux }} + args: ${{ matrix.platform.maturin_args }} + - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: wheels-${{ matrix.platform.runner }} - path: booster_sdk_py/dist/ + name: wheels-${{ matrix.platform.id }} + path: dist/*.whl publish: runs-on: ubuntu-22.04 @@ -41,7 +101,9 @@ jobs: pattern: wheels-* merge-multiple: true path: dist/ + - name: Install uv uses: astral-sh/setup-uv@v5 + - name: Publish to PyPI run: uv publish dist/* diff --git a/Cargo.lock b/Cargo.lock index 55d899f..55be2fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,7 +46,7 @@ checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" [[package]] name = "booster_sdk" -version = "0.1.0-alpha.5" +version = "0.1.0-alpha.6" dependencies = [ "rustdds", "serde", @@ -61,7 +61,7 @@ dependencies = [ [[package]] name = "booster_sdk_py" -version = "0.1.0-alpha.5" +version = "0.1.0-alpha.6" dependencies = [ "booster_sdk", "pyo3", diff --git a/Cargo.toml b/Cargo.toml index 88284c8..00bc78b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["booster_sdk", "booster_sdk_py"] resolver = "2" [workspace.package] -version = "0.1.0-alpha.5" +version = "0.1.0-alpha.6" edition = "2024" authors = ["Team whIRLwind"] license = "MIT OR Apache-2.0" diff --git a/pixi.toml b/pixi.toml index e77dc8d..a717c4e 100644 --- a/pixi.toml +++ b/pixi.toml @@ -3,7 +3,7 @@ authors = ["Team whIRLwind"] channels = ["conda-forge"] name = "booster-sdk" platforms = ["osx-arm64", "linux-64", "linux-aarch64"] -version = "0.1.0-alpha.4" +version = "0.1.0-alpha.6" [environments] py = ["wheel-build", "python-tasks"]