Skip to content

Merge pull request #30 from andri-jpg/main #29

Merge pull request #30 from andri-jpg/main

Merge pull request #30 from andri-jpg/main #29

Workflow file for this run

name: CI-Metal
env:
PYPROJECT_NAME: "llm-rs-metal"
on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
macos:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install build dependencies
run: pip install -r ./build_scripts/requirements.txt
- name: Set package name
run: python ./build_scripts/pyproject_patcher.py
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter --features metal
sccache: 'true'
env:
CC: clang
CXX: clang++
MACOSX_DEPLOYMENT_TARGET: 10.9
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install build dependencies
run: pip install -r ./build_scripts/requirements.txt
- name: Set package name
run: python ./build_scripts/pyproject_patcher.py
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- 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: [macos, sdist]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --skip-existing *