Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[target.'cfg(all(target_arch = "x86_64", target_os = "linux"))']
rustflags = ["-C", "link-arg=-lgcc"]

[target.i686-unknown-linux-gnu]
rustflags = ["-C", "target-feature=-crt-static"]

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

[target.s390x-unknown-linux-gnu]
linker = "s390x-linux-gnu-gcc"

[target.powerpc64le-unknown-linux-gnu]
linker = "powerpc64le-linux-gnu-gcc"
70 changes: 51 additions & 19 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
branches:
- main
- master
- ci-*
tags:
- '*'
pull_request:
Expand All @@ -24,22 +25,50 @@ jobs:
strategy:
matrix:
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
include:
- target: x86_64
manylinux: auto
container: quay.io/pypa/manylinux2014_x86_64:latest
- target: x86
manylinux: auto
container: quay.io/pypa/manylinux2014_i686:latest
- target: aarch64
manylinux: '2_28'
- target: armv7
manylinux: '2_28'
- target: s390x
manylinux: '2_28'
- target: ppc64le
manylinux: '2_28'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set environment variables for ring compilation
run: |
echo "CARGO_NET_GIT_FETCH_WITH_CLI=true" >> $GITHUB_ENV
echo "RUST_BACKTRACE=1" >> $GITHUB_ENV
if [ -n "${{ matrix.rustflags }}" ]; then
echo "RUSTFLAGS=${{ matrix.rustflags }}" >> $GITHUB_ENV
fi
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
uses: PyO3/maturin-action@v1.44.0
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
manylinux: auto
manylinux: ${{ matrix.manylinux }}
docker-options: |
-e CARGO_NET_GIT_FETCH_WITH_CLI=true
-e RUST_BACKTRACE=1
env:
CARGO_NET_GIT_FETCH_WITH_CLI: true
RUST_BACKTRACE: 1
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-linux-${{ matrix.target }}
path: dist

windows:
Expand All @@ -48,21 +77,21 @@ jobs:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@v1
uses: PyO3/maturin-action@v1.44.0
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-windows-${{ matrix.target }}
path: dist

macos:
Expand All @@ -71,35 +100,35 @@ jobs:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@v1
uses: PyO3/maturin-action@v1.44.0
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-macos-${{ matrix.target }}
path: dist

sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
uses: PyO3/maturin-action@v1.44.0
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-sdist
path: dist

release:
Expand All @@ -108,11 +137,14 @@ jobs:
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v3
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
name: wheels
pattern: wheels-*
path: dist/
merge-multiple: true
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
uses: PyO3/maturin-action@v1.44.0
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nacos-sdk-rust-binding-py"
version = "0.5.0"
version = "0.5.2"
edition = "2024"
license = "Apache-2.0"
publish = false
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ classifiers = [
description = "nacos-sdk-rust binding for Python."
license = { text = "Apache-2.0" }
readme = "README.md"
dynamic = ["version"]

[project.optional-dependencies]
docs = ["pdoc"]
Expand Down