-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
527 additions
and
287 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
# This file is autogenerated by maturin v1.3.1 | ||
# To update, run | ||
# | ||
# maturin generate-ci --platform linux --platform macos --platform windows --manifest-path ./sdk/Cargo.toml --output .github/workflows/sdk-wheels.yml github | ||
# | ||
name: SDK Wheels | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'sdk/**' | ||
branches: | ||
- main | ||
- master | ||
tags: | ||
- '*' | ||
pull_request: | ||
paths: | ||
- 'sdk/**' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
tests: | ||
uses: ./.github/workflows/sdk.yml | ||
linux: | ||
needs: [tests] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
target: [x86_64, x86] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
args: --release --out dist --find-interpreter --manifest-path ./sdk/Cargo.toml --features openssl/vendored | ||
manylinux: auto | ||
before-script-linux: | | ||
# If we're running on rhel centos, install needed packages. | ||
if command -v yum &> /dev/null; then | ||
yum update -y && yum install -y perl-core libatomic | ||
# 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 | ||
fi | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
|
||
windows: | ||
needs: [tests] | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
target: [x64, x86] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
architecture: ${{ matrix.target }} | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
args: --release --out dist --find-interpreter --manifest-path ./sdk/Cargo.toml --features openssl/vendored | ||
sccache: 'true' | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
|
||
macos: | ||
needs: [tests] | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
target: [x86_64, aarch64] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
args: --release --out dist --find-interpreter --manifest-path ./sdk/Cargo.toml --features openssl/vendored | ||
sccache: 'true' | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
|
||
sdist: | ||
needs: [tests] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build sdist | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
command: sdist | ||
args: --out dist --manifest-path ./sdk/Cargo.toml | ||
- name: Upload sdist | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: dist | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
if: "startsWith(github.ref, 'refs/tags/')" | ||
needs: [linux, windows, macos, sdist] | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: wheels | ||
- name: Publish to PyPI | ||
uses: PyO3/maturin-action@v1 | ||
env: | ||
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | ||
with: | ||
command: upload | ||
args: --non-interactive --skip-existing * |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: SDK | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
sdk_check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./sdk | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- name: fmt | ||
run: cargo fmt --check | ||
- name: clippy | ||
run: cargo clippy -- -D warnings | ||
- uses: jordemort/action-pyright@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
workdir: ./sdk | ||
fail_on_error: true | ||
sdk_test: | ||
name: Build & Test | ||
needs: [sdk_check] | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./sdk | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: Build | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
args: --release --features openssl/vendored | ||
working-directory: ./sdk | ||
- name: Test | ||
run: | | ||
python -m venv .env | ||
source .env/bin/activate | ||
maturin develop --release --features openssl/vendored | ||
python test.py |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.env/ | ||
target/ |
Oops, something went wrong.