Skip to content

Commit

Permalink
Add CI step for maturin
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Jul 26, 2022
1 parent 5c1e8c9 commit e28cb6c
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 2 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,70 @@ jobs:
- run: rustup target add wasm32-unknown-unknown
- run: ./crates/re_viewer/setup_web.sh
- run: ./crates/re_viewer/wasm_bindgen_check.sh

maturin-linux:
name: Maturin Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: messense/maturin-action@v1
with:
manylinux: auto
maturin-version: "0.12.20"
command: build
args: -m crates/re_sdk_python/Cargo.toml --release -o dist
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist

maturin-windows:
name: Maturin Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: messense/maturin-action@v1
with:
maturin-version: "0.12.20"
command: build
args: -m crates/re_sdk_python/Cargo.toml --release --no-sdist -o dist
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist

maturin-macos:
name: Maturin MacOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: messense/maturin-action@v1
with:
maturin-version: "0.12.20"
command: build
args: -m crates/re_sdk_python/Cargo.toml --release --no-sdist -o dist --universal2
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist

maturin-release:
name: Maturin Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [maturin-macos, maturin-windows, maturin-linux]
steps:
- uses: actions/download-artifact@v2
with:
name: wheels
- name: Publish to PyPI
uses: messense/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
maturin-version: "0.12.20"
command: upload
args: -m crates/re_sdk_python/Cargo.toml --skip-existing *
4 changes: 2 additions & 2 deletions crates/re_sdk_python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ Then run the test logging:

Debug build:
``` sh
(cd crates/re_sdk_python && maturin develop) && RUST_LOG=debug python3 test.py
maturin develop -m crates/re_sdk_python/Cargo.toml && RUST_LOG=debug python3 test.py
```

Release build:
``` sh
(cd crates/re_sdk_python && maturin develop) --release && RUST_LOG=debug python3 test.py
maturin develop -m crates/re_sdk_python/Cargo.toml --release && RUST_LOG=debug python3 test.py
```

0 comments on commit e28cb6c

Please sign in to comment.