-
-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Maturin directly for building distributions
- Loading branch information
Showing
139 changed files
with
543 additions
and
373 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
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 |
---|---|---|
|
@@ -7,87 +7,91 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }}-latest | ||
linux: | ||
name: Build wheels on Linux - ${{ matrix.target }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
os: [ ubuntu, windows, macos ] | ||
|
||
target: [x86_64, aarch64, armv7] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up rust | ||
uses: dtolnay/rust-toolchain@stable | ||
- uses: actions/setup-python@v4 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Setup Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
python-version: '3.10' | ||
- name: Build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
key: ${{ matrix.os }} | ||
|
||
- name: Set up QEMU | ||
if: runner.os == 'Linux' | ||
uses: docker/setup-qemu-action@v2 | ||
target: ${{ matrix.target }} | ||
args: --release --out dist --find-interpreter | ||
sccache: 'true' | ||
manylinux: auto | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
platforms: all | ||
name: dist | ||
path: dist | ||
|
||
windows: | ||
name: Build wheels on Windows - ${{ matrix.target }} | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: | ||
target: [x64] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
architecture: ${{ matrix.target }} | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS_LINUX: auto aarch64 | ||
CIBW_ARCHS_MACOS: x86_64 | ||
CIBW_ARCHS_WINDOWS: AMD64 | ||
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
package-dir: . | ||
output-dir: dist | ||
|
||
- uses: actions/upload-artifact@v3 | ||
target: ${{ matrix.target }} | ||
args: --release --out dist --find-interpreter | ||
sccache: 'true' | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: ./dist/* | ||
path: dist | ||
|
||
build_wheels_macos_arm: | ||
name: Build arm64 wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
macos: | ||
name: Build wheels on MacOS - ${{ matrix.target }} | ||
runs-on: macos-latest | ||
strategy: | ||
matrix: | ||
os: [ macos-12 ] | ||
|
||
target: [x86_64, aarch64] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: stable | ||
|
||
- name: Setup Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
key: ${{ matrix.os }} | ||
|
||
python-version: '3.10' | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS_MACOS: arm64 | ||
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
package-dir: . | ||
output-dir: dist | ||
|
||
- name: Fix wheel tags | ||
run: | | ||
python3 -m pip install wheel | ||
python3 -m wheel tags --platform-tag macosx_12_0_arm64 dist/*-macosx*.whl --remove | ||
target: ${{ matrix.target }} | ||
args: --release --out dist --find-interpreter | ||
sccache: 'true' | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
- uses: actions/upload-artifact@v3 | ||
sdist: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build sdist | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
command: sdist | ||
args: --out dist | ||
- name: Upload sdist | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: ./dist/* | ||
path: dist | ||
|
||
|
||
Release: | ||
|
@@ -112,9 +116,6 @@ jobs: | |
- name: Update PATH | ||
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
|
||
- name: Build sdist | ||
run: poetry build --format sdist | ||
|
||
- name: Check distributions | ||
run: | | ||
ls -la dist | ||
|
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
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 |
---|---|---|
|
@@ -36,3 +36,4 @@ setup.py | |
|
||
.vscode | ||
/target | ||
/rust/target |
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
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
Oops, something went wrong.