Merge pull request #186 from ultima-ib/frtb_pyengine #37
Workflow file for this run
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: CI | |
on: | |
push: | |
tags: ['py*.*.*'] | |
# TODO Manual Trigger | |
# on: | |
# workflow_dispatch: | |
permissions: | |
contents: read | |
id-token: write | |
env: | |
RUST_TOOLCHAIN: stable | |
PYTHON_VERSION: '3.9' | |
MATURIN_VERSION: '1.2.1' | |
jobs: | |
linux: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Node | |
run: npm install | |
working-directory: frontend | |
- name: Build Node | |
run: npm run build | |
working-directory: frontend | |
- uses: awalsh128/cache-apt-pkgs-action@v1 | |
with: | |
packages: musl-tools # provides musl-gcc | |
version: 1.0 | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --manifest-path pyultima/Cargo.toml | |
sccache: 'true' | |
manylinux: auto | |
# Install tools depending on the architecture | |
# https://github.com/Intreecom/scyllapy/blob/develop/.github/workflows/release.yaml | |
before-script-linux: | | |
# If we're running on rhel centos(Alpine), install needed packages. | |
if command -v yum &> /dev/null; then | |
apk add --no-cache musl-dev | |
yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig 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 | |
else | |
# If we're running on debian-based system. | |
apt update -y && apt-get install -y libssl-dev openssl pkg-config musl-tools | |
fi | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
target: [x64, x86] | |
env: | |
OPENSSL_NO_VENDOR: 1 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
architecture: ${{ matrix.target }} | |
- name: Install OpenSSL (Windows) | |
if: matrix.target == 'x64' | |
shell: powershell | |
run: | | |
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append | |
vcpkg install openssl:x64-windows-static-md | |
- name: Install OpenSSL (Windows) | |
if: matrix.target == 'x86' | |
shell: powershell | |
run: | | |
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append | |
vcpkg install openssl:x86-windows-static-md | |
- name: Install Node | |
run: npm install | |
working-directory: frontend | |
- name: Build Node | |
run: npm run build | |
working-directory: frontend | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --manifest-path pyultima/Cargo.toml | |
sccache: 'true' | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
target: [x86_64, aarch64] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install Node | |
run: npm install | |
working-directory: frontend | |
- name: Build Node | |
run: npm run build | |
working-directory: frontend | |
- name: Build wheels | |
uses: PyO3/maturin-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
args: --release --out dist --manifest-path pyultima/Cargo.toml | |
sccache: 'true' | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
sdist: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build sdist | |
uses: PyO3/maturin-action@v1 | |
with: | |
command: sdist | |
args: --out dist --manifest-path pyultima/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 | |
with: | |
command: upload | |
args: --non-interactive --skip-existing * | |
# name: Create Python release | |
# #on: | |
# # release: | |
# # types: [published] | |
# on: | |
# push: | |
# tags: ['py*.*.*'] | |
# env: | |
# RUST_TOOLCHAIN: stable | |
# PYTHON_VERSION: '3.9' | |
# MATURIN_VERSION: '1.2.1' | |
# defaults: | |
# run: | |
# shell: bash | |
# jobs: | |
# manylinux-x64_64: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: actions/setup-python@v4 | |
# with: | |
# python-version: ${{ env.PYTHON_VERSION }} | |
# - name: Install tools | |
# run: | | |
# sudo apt update | |
# sudo apt install -y pkg-config libssl-dev | |
# - name: Setup node | |
# uses: actions/setup-node@v1 | |
# with: | |
# node-version: "16.x" | |
# - name: Install Node | |
# run: npm install | |
# working-directory: frontend | |
# - name: Build Node | |
# run: npm run build | |
# working-directory: frontend | |
# - name: Publish wheel | |
# uses: PyO3/maturin-action@v1 | |
# env: | |
# MATURIN_PASSWORD: ${{ secrets.PYPI_PASS }} | |
# RUSTFLAGS: -C target-feature=+fxsr,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt,+avx,+fma | |
# with: | |
# rust-toolchain: ${{ env.RUST_TOOLCHAIN }} | |
# maturin-version: ${{ env.MATURIN_VERSION }} | |
# command: publish | |
# args: -m pyultima/Cargo.toml --all-features --skip-existing -o wheels -u anatoly.bugakov | |
# # Needed for Docker on Apple M1 | |
# manylinux-aarch64: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: actions/setup-python@v4 | |
# with: | |
# python-version: ${{ env.PYTHON_VERSION }} | |
# - name: Install tools | |
# run: | | |
# sudo apt-get update | |
# sudo apt-get install -y pkg-config libssl-dev | |
# - name: Setup node | |
# uses: actions/setup-node@v1 | |
# with: | |
# node-version: "16.x" | |
# - name: Install Node | |
# run: npm install | |
# working-directory: frontend | |
# - name: Build Node | |
# run: npm run build | |
# working-directory: frontend | |
# - name: Publish wheel | |
# uses: PyO3/maturin-action@v1 | |
# env: | |
# MATURIN_PASSWORD: ${{ secrets.PYPI_PASS }} | |
# JEMALLOC_SYS_WITH_LG_PAGE: 16 | |
# with: | |
# rust-toolchain: ${{ env.RUST_TOOLCHAIN }} | |
# target: aarch64-unknown-linux-gnu | |
# maturin-version: ${{ env.MATURIN_VERSION }} | |
# command: publish | |
# args: -m pyultima/Cargo.toml --all-features --skip-existing --no-sdist -o wheels -i python -u anatoly.bugakov | |
# win-macos: | |
# runs-on: ${{ matrix.os }} | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# os: [macos-latest, windows-latest] | |
# env: | |
# OPENSSL_NO_VENDOR: 1 | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: actions/setup-python@v4 | |
# with: | |
# python-version: ${{ env.PYTHON_VERSION }} | |
# - name: Install OpenSSL (Windows) | |
# if: runner.os == 'Windows' | |
# shell: powershell | |
# run: | | |
# echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append | |
# vcpkg install openssl:x64-windows-static-md | |
# - name: Setup node | |
# uses: actions/setup-node@v1 | |
# with: | |
# node-version: "16.x" | |
# - name: Install Node | |
# run: npm install | |
# working-directory: frontend | |
# - name: Build Node | |
# run: npm run build | |
# working-directory: frontend | |
# - name: Publish wheel | |
# uses: PyO3/maturin-action@v1 | |
# env: | |
# MATURIN_PASSWORD: ${{ secrets.PYPI_PASS }} | |
# RUSTFLAGS: -C target-feature=+fxsr,+sse,+sse2,+sse3,+sse4.1,+sse4.2 | |
# with: | |
# rust-toolchain: ${{ env.RUST_TOOLCHAIN }} | |
# maturin-version: ${{ env.MATURIN_VERSION }} | |
# command: publish | |
# args: -m pyultima/Cargo.toml --all-features --no-sdist --skip-existing -o wheels -i python -u anatoly.bugakov | |
# This job fails - understand/check why | |
# macos-aarch64: | |
# runs-on: macos-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# - uses: actions/setup-python@v4 | |
# with: | |
# python-version: ${{ env.PYTHON_VERSION }} | |
# | |
# - name: Set up Rust | |
# uses: dtolnay/rust-toolchain@master | |
# with: | |
# toolchain: nightly-2022-12-20 | |
# | |
# - name: Set up Rust targets | |
# run: rustup target add aarch64-apple-darwin | |
# | |
# - name: Publish wheel | |
# uses: messense/maturin-action@v1 | |
# env: | |
# MATURIN_PASSWORD: ${{ secrets.PYPI_PASS }} | |
# with: | |
# maturin-version: ${{ env.MATURIN_VERSION }} | |
# command: publish | |
# args: -m pyultima/Cargo.toml --all-features --target aarch64-apple-darwin --no-sdist -o wheels -i python -u anatoly.bugakov |