WIP: wheel cross-compilation

pull/592/head
Tpt 2 years ago
parent f183196859
commit 534f510efa
  1. 31
      .github/workflows/artifacts.yml
  2. 57
      .github/workflows/test.yml
  3. 4
      .github/workflows/tests.yml

@ -37,7 +37,7 @@ jobs:
path: target/release/oxigraph_server path: target/release/oxigraph_server
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:
name: oxigraph_server_aarch64-linux_gnu name: oxigraph_server_aarch64_linux_gnu
path: target/aarch64-unknown-linux-gnu/release/oxigraph_server path: target/aarch64-unknown-linux-gnu/release/oxigraph_server
- run: mv target/release/oxigraph_server oxigraph_server_${{ github.event.release.tag_name }}_x86_64_linux_gnu - run: mv target/release/oxigraph_server oxigraph_server_${{ github.event.release.tag_name }}_x86_64_linux_gnu
if: github.event_name == 'release' if: github.event_name == 'release'
@ -181,20 +181,24 @@ jobs:
cache: pip cache: pip
cache-dependency-path: '**/requirements.dev.txt' cache-dependency-path: '**/requirements.dev.txt'
- run: pip install -r python/requirements.dev.txt - run: pip install -r python/requirements.dev.txt
- run: maturin build --release -m python/Cargo.toml --features abi3 - run: maturin build --release --features abi3
working-directory: ./python
- run: pip install --no-index --find-links=target/wheels/ pyoxigraph - run: pip install --no-index --find-links=target/wheels/ pyoxigraph
- run: rm -r target/wheels - run: rm -r target/wheels
- run: python generate_stubs.py pyoxigraph pyoxigraph.pyi --black - run: python generate_stubs.py pyoxigraph pyoxigraph.pyi --black
working-directory: ./python working-directory: ./python
- run: maturin build --release --target universal2-apple-darwin -m python/Cargo.toml --features abi3 - run: maturin build --release --features abi3
- run: maturin build --release -m python/Cargo.toml --features abi3 working-directory: ./python
if: github.event_name == 'release' - run: maturin build --release --target aarch64-apple-darwin --features abi3
- run: maturin build --release --target aarch64-apple-darwin -m python/Cargo.toml --features abi3 working-directory: ./python
if: github.event_name == 'release'
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:
name: pyoxigraph_wheel_universal2_mac name: pyoxigraph_wheel_x86_64_mac
path: target/wheels/*.whl path: target/wheels/*_x86_64.whl
- uses: actions/upload-artifact@v3
with:
name: pyoxigraph_wheel_aarch64_mac
path: target/wheels/*_arm64.whl
- run: pip install twine && twine upload target/wheels/* - run: pip install twine && twine upload target/wheels/*
env: env:
TWINE_USERNAME: __token__ TWINE_USERNAME: __token__
@ -216,13 +220,16 @@ jobs:
cache-dependency-path: '**/requirements.dev.txt' cache-dependency-path: '**/requirements.dev.txt'
- run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse - run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse
- run: pip install -r python/requirements.dev.txt - run: pip install -r python/requirements.dev.txt
- run: maturin build --release -m python/Cargo.toml --features abi3 - run: maturin build --release --features abi3
working-directory: ./python
- run: pip install --no-index --find-links=target/wheels/ pyoxigraph - run: pip install --no-index --find-links=target/wheels/ pyoxigraph
- run: rm -r target/wheels - run: rm -r target/wheels
- run: python generate_stubs.py pyoxigraph pyoxigraph.pyi --black - run: python generate_stubs.py pyoxigraph pyoxigraph.pyi --black
working-directory: ./python working-directory: ./python
- run: maturin build --release -m python/Cargo.toml --features abi3 - run: maturin build --release --features abi3
- run: maturin sdist -m python/Cargo.toml working-directory: ./python
- run: maturin sdist
working-directory: ./python
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with:
name: pyoxigraph_wheel_x86_64_windows name: pyoxigraph_wheel_x86_64_windows

@ -0,0 +1,57 @@
name: Artifacts
on:
pull_request:
branches:
- main
- next
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
binary_linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- run: rustup update && rustup target add aarch64-unknown-linux-gnu
- run: |
sudo apt update && sudo apt install -y g++-aarch64-linux-gnu
echo -e "\n\n[target.aarch64-unknown-linux-gnu]\nlinker = \"aarch64-linux-gnu-gcc\"" >> .cargo/config.toml
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
cache-dependency-path: '**/requirements.dev.txt'
- run: pip install -r python/requirements.dev.txt
- run: maturin build --release --features abi3
working-directory: ./python
- run: pip install --no-index --find-links=target/wheels/ pyoxigraph
- run: python generate_stubs.py pyoxigraph pyoxigraph.pyi --black
working-directory: ./python
- run: maturin build --release --features abi3 --compatibility manylinux2014
working-directory: ./python
- run: maturin build --release --target aarch64-unknown-linux-gnu --features abi3 --compatibility manylinux2014
working-directory: ./python
env:
BINDGEN_EXTRA_CLANG_ARGS: --sysroot /usr/aarch64-linux-gnu
# TODO TARGET_CC: /usr/bin/aarch64-linux-gnu-gcc
# TODO TARGET_AR: /usr/bin/aarch64-linux-gnu-ar
- uses: actions/upload-artifact@v3
with:
name: pyoxigraph_wheel_x86_64_linux_gnu
path: target/wheels/*_x86_64.whl
- uses: actions/upload-artifact@v3
with:
name: pyoxigraph_wheel_aarch64_linux_gnu
path: target/wheels/*_aarch64.whl
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
packages-dir: target/wheels
if: github.event_name == 'release'

@ -1,10 +1,6 @@
name: Change tests name: Change tests
on: on:
pull_request:
branches:
- main
- next
schedule: schedule:
- cron: "12 3 * * *" - cron: "12 3 * * *"

Loading…
Cancel
Save