Update IB documentation and misc enhancements / bug fixes (#1336) #107
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
name: build-wheels | |
# Build wheels on every push to `develop` branch | |
on: | |
push: | |
branches: [develop] | |
jobs: | |
build-wheels: | |
# if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [x64] | |
os: [ubuntu-latest] | |
python-version: ["3.11"] | |
name: build - Python ${{ matrix.python-version }} (${{ matrix.arch }} ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Get Rust version from rust-toolchain.toml | |
id: rust-version | |
run: | | |
version=$(awk -F\" '/version/ {print $2}' nautilus_core/rust-toolchain.toml) | |
echo "Rust toolchain version $version" | |
echo "RUST_VERSION=$version" >> $GITHUB_ENV | |
working-directory: ${{ github.workspace }} | |
- name: Set up Rust tool-chain (Linux, Windows) stable | |
if: (runner.os == 'Linux') || (runner.os == 'Windows') | |
uses: actions-rust-lang/[email protected] | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
components: rustfmt, clippy | |
# Work around as actions-rust-lang does not seem to work on macOS yet | |
- name: Set up Rust tool-chain (macOS) stable | |
if: runner.os == 'macOS' | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ env.RUST_VERSION }} | |
override: true | |
components: rustfmt, clippy | |
- name: Set up Python environment | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get Poetry version from poetry-version | |
run: | | |
version=$(cat poetry-version) | |
echo "POETRY_VERSION=$version" >> $GITHUB_ENV | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
version: ${{ env.POETRY_VERSION }} | |
- name: Install build dependencies | |
run: python -m pip install --upgrade pip setuptools wheel msgspec | |
- name: Set poetry cache-dir | |
run: echo "POETRY_CACHE_DIR=$(poetry config cache-dir)" >> $GITHUB_ENV | |
- name: Poetry cache | |
id: cached-poetry | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.POETRY_CACHE_DIR }} | |
key: ${{ runner.os }}-${{ matrix.python-version }}-poetry-${{ hashFiles('**/poetry.lock') }} | |
- name: Install / Build | |
run: | | |
poetry install | |
poetry build --format wheel | |
- name: Set release output | |
id: vars | |
run: | | |
echo "ASSET_PATH=$(find ./dist -mindepth 1 -print -quit)" >> $GITHUB_ENV | |
cd dist | |
echo "ASSET_NAME=$(printf '%s\0' * | awk 'BEGIN{RS="\0"} {print; exit}')" >> $GITHUB_ENV | |
- name: Upload wheel artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.ASSET_NAME }} | |
path: ${{ env.ASSET_PATH }} |