llama.cpp/.github/workflows/build-and-release.yaml

109 lines
2.6 KiB
YAML
Raw Normal View History

2023-04-10 05:29:32 +00:00
name: Build Release
2023-04-07 07:14:38 +00:00
2023-04-08 07:11:25 +00:00
on: workflow_dispatch
2023-04-07 07:14:38 +00:00
2023-04-10 06:35:00 +00:00
permissions:
contents: write
2023-04-07 07:14:38 +00:00
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
2023-04-07 07:14:38 +00:00
steps:
- uses: actions/checkout@v3
2023-04-07 07:19:07 +00:00
with:
submodules: "recursive"
2023-04-07 07:14:38 +00:00
# Used to host cibuildwheel
- uses: actions/setup-python@v3
2023-11-06 13:56:41 +00:00
with:
python-version: "3.8"
2023-04-07 07:14:38 +00:00
2023-04-07 07:18:56 +00:00
- name: Install dependencies
run: |
python -m pip install --upgrade pip
2023-11-10 10:54:23 +00:00
python -m pip install -e .[all]
2023-04-07 07:18:56 +00:00
2023-04-07 07:14:38 +00:00
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
2023-11-10 11:05:42 +00:00
env:
# disable repair
CIBW_REPAIR_WHEEL_COMMAND: ""
with:
package-dir: .
output-dir: wheelhouse
2023-04-07 07:14:38 +00:00
- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
2023-04-10 05:29:32 +00:00
2024-04-23 06:48:09 +00:00
build_arm64_wheels:
name: Build arm64 wheels
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm64
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
env:
CIBW_SKIP: "*musllinux* pp*"
CIBW_REPAIR_WHEEL_COMMAND: ""
CIBW_ARCHS: "aarch64"
CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-* cp312-*"
with:
output-dir: wheelhouse/
- name: Upload wheels as artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.version }}
path: wheelhouse/*.whl
2023-04-10 05:29:32 +00:00
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "recursive"
2023-04-10 05:29:32 +00:00
- uses: actions/setup-python@v3
2023-11-06 13:56:41 +00:00
with:
python-version: "3.8"
2023-04-10 05:29:32 +00:00
- name: Install dependencies
run: |
python -m pip install --upgrade pip build
python -m pip install -e .[all]
2023-04-10 05:29:32 +00:00
- name: Build source distribution
run: |
python -m build --sdist
2023-04-10 05:29:32 +00:00
- uses: actions/upload-artifact@v3
with:
2023-04-10 05:54:52 +00:00
path: ./dist/*.tar.gz
release:
name: Release
2024-04-23 06:48:09 +00:00
needs: [build_wheels, build_arm64_wheels, build_sdist]
2023-04-10 05:54:52 +00:00
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: softprops/action-gh-release@v1
with:
files: dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}