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

80 lines
1.8 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:
2023-04-10 05:29:32 +00:00
os: [ubuntu-latest, windows-latest, macOS-latest]
2023-04-07 07:14:38 +00:00
steps:
- uses: actions/checkout@v3
2023-04-07 07:19:07 +00:00
with:
submodules: "true"
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
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.12.1
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
run: python -m cibuildwheel --output-dir wheelhouse
2023-11-10 11:05:42 +00:00
env:
# disable repair
CIBW_REPAIR_WHEEL_COMMAND: ""
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
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: "true"
- 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
needs: [build_wheels, build_sdist]
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 }}