Skip to content

🐛 fix split

🐛 fix split #45

Workflow file for this run

name: Build
on:
push:
tags:
- 'build/*'
pull_request:
types:
- opened
paths:
- '.github/workflows/**'
- 'src/tarina/*_c.c'
- 'src/tarina/*_c.pyx'
release:
types: [published]
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build_sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
uses: py-actions/py-dependency-install@v4
with:
path: requirements/cython.txt
- name: Cythonize
run: |
make cythonize
- name: Build sdist
run: |
pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
build_pure_wheel:
name: Build pure wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
uses: py-actions/py-dependency-install@v4
with:
path: requirements/cython.txt
- name: Cythonize
run: |
make cythonize
- name: Build wheel
run: |
export TARINA_NO_EXTENSIONS=1
pipx run build --wheel
- uses: actions/upload-artifact@v3
with:
path: dist/*.whl
build_wheels:
name: Build wheels on ${{ matrix.os }} ${{ matrix.qemu }}
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [ubuntu, windows, macos]
qemu: ['']
include:
- os: ubuntu
qemu: aarch64
- os: ubuntu
qemu: ppc64le
- os: ubuntu
qemu: s390x
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
if: ${{ matrix.qemu }}
uses: docker/setup-qemu-action@v2
with:
platforms: all
id: qemu
- name: Prepare emulation
run: |
if [[ -n "${{ matrix.qemu }}" ]]; then
# Build emulated architectures only if QEMU is set,
# use default "auto" otherwise
echo "CIBW_ARCHS_LINUX=${{ matrix.qemu }}" >> $GITHUB_ENV
fi
shell: bash
- name: Set up Python
uses: actions/setup-python@v4
- name: Install cython
uses: py-actions/py-dependency-install@v4
with:
path: requirements/cython.txt
- name: Cythonize
run: |
make cythonize
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: x86_64 arm64 universal2
CIBW_ARCHS_LINUX: auto
CIBW_ARCHS_WINDOWS: auto x86
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
release:
name: Release
runs-on: ubuntu-latest
if: github.event_name == 'release'
needs: [build_sdist, build_pure_wheel, build_wheels]
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish package
uses: pypa/[email protected]
with:
verbose: true
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: upload release asset
run: |
gh release upload ${{ github.event.release.tag_name }} dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}