Skip to content

move nucliadb_node/binding to the root [sc-6670] #113

move nucliadb_node/binding to the root [sc-6670]

move nucliadb_node/binding to the root [sc-6670] #113

name: Release NucliaDB Node
on:
pull_request:
branches:
- main
paths:
- ".github/workflows/nucliadb_node_release.yml"
- "nucliadb_node/binding/Cargo.toml"
push:
branches:
- main
paths:
- ".github/workflows/nucliadb_node_release.yml"
- "nucliadb_node/binding/Cargo.toml"
jobs:
build:
name: Build on ${{ matrix.platform || matrix.os }} (${{ matrix.target }} - ${{ matrix.manylinux || 'auto' }})
strategy:
fail-fast: false
matrix:
os: [ubuntu, macos, windows]
target: [x86_64, aarch64]
manylinux: [auto]
include:
- os: ubuntu
platform: linux
- os: windows
ls: dir
interpreter: 3.7 3.8 3.9 3.10 3.11
# - os: windows
# ls: dir
# target: i686
# python-architecture: x86
# interpreter: 3.7 3.8 3.9 3.10
- os: macos
target: aarch64
interpreter: 3.7 3.8 3.9 3.10 3.11
# - os: ubuntu
# platform: linux
# target: i686
# GCC 4.8.5 in manylinux2014 container doesn't support c11 atomic
# we use manylinux_2_24 container for aarch64 and armv7 targets instead,
- os: ubuntu
platform: linux
target: aarch64
container: messense/manylinux_2_24-cross:aarch64
# - os: ubuntu
# platform: linux
# target: armv7
# container: messense/manylinux_2_24-cross:armv7
# interpreter: 3.7 3.8 3.9 3.10 3.11
# musllinux
- os: ubuntu
platform: linux
target: x86_64
manylinux: musllinux_1_1
- os: ubuntu
platform: linux
target: aarch64
manylinux: musllinux_1_1
exclude:
# Windows on arm64 only supports Python 3.11+
- os: windows
target: aarch64
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v3
- name: set up python
uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: ${{ matrix.python-architecture || 'x64' }}
- run: pip install -U twine 'black>=22.3.0,<23' typing_extensions
- name: build sdist
if: ${{ matrix.os == 'ubuntu' && matrix.target == 'x86_64' && matrix.manylinux == 'auto' }}
uses: messense/maturin-action@v1
with:
command: sdist
args: -m nucliadb_node/binding/Cargo.toml --out dist
rust-toolchain: stable
- name: build wheels
uses: messense/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: ${{ matrix.manylinux || 'auto' }}
container: ${{ matrix.container }}
args: -m nucliadb_node/binding/Cargo.toml --release --out dist --interpreter ${{ matrix.interpreter || '3.7 3.8 3.9 3.10 3.11 pypy3.7 pypy3.8 pypy3.9' }}
rust-toolchain: stable
- run: ${{ matrix.ls || 'ls -lh' }} dist/
- run: twine check dist/*
- uses: actions/upload-artifact@v3
with:
name: pypi_files
path: dist
list-pypi-files:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: get dist artifacts
uses: actions/download-artifact@v3
with:
name: pypi_files
path: dist
- run: ls -lh dist/
- run: echo "`ls dist | wc -l` files"
release:
needs: [build]
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- name: set up python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: pip install -U twine
- name: get dist artifacts
uses: actions/download-artifact@v3
with:
name: pypi_files
path: dist
- run: twine check dist/*
- name: upload to pypi
run: twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}