Merge pull request #191 from ultima-ib/frtb_pyengine #42
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-aarch64: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repository | |
uses: actions/checkout@v4 | |
- name: Install Node | |
run: npm install | |
working-directory: frontend | |
- name: Build Node | |
run: npm run build | |
working-directory: frontend | |
- name: Build wheels | |
uses: messense/maturin-action@v1 | |
with: | |
# 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 | |
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 | |
fi | |
target: aarch64 | |
manylinux: manylinux_2_28 # auto doesn't work see https://github.com/briansmith/ring/issues/1728#issuecomment-1758180655 | |
args: --release --out dist --manifest-path pyultima/Cargo.toml | |
- name: Upload wheels | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheels | |
path: dist | |
linux: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
target: [x86_64, x86, armv7, i686, ppc64le] | |
steps: | |
- uses: actions/checkout@v3 | |
# TODO Remove if not needed | |
# - 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' | |
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 | |
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 | |
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, linux-aarch64, 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 * |