ggml-ui / .github /workflows /build-llama-cpp-wheel.yml
winglian's picture
support for ctransformers
6025266
raw
history blame
1.84 kB
name: Build wheel in Docker
on:
push:
tags:
- '*-llama' # Will match tags ending with -llama
release:
types: [published]
jobs:
build:
runs-on: self-hosted
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Extract version from tag
id: get_version
run: echo "::set-output name=version::${GITHUB_REF#refs/tags/}"
- name: Separate version and suffix
id: separate
run: |
VERSION=$(echo ${{ steps.get_version.outputs.version }} | rev | cut -d'-' -f2- | rev)
echo "::set-output name=prefix::$VERSION"
- name: Build Docker image
run: docker build . -t artifact-builder -f Dockerfile-llama-cpp-wheel
- name: Build Docker image
run: docker build . -t artifact-builder --build-arg LLAMA_CPP_VERSION=${{ steps.separate.outputs.prefix }} -f Dockerfile-llama-cpp-wheel
- name: Copy GPU artifact from Docker container
run: |
docker cp my-artifact-builder:/build/dists/llama_cpp_python-gpu-${{ steps.separate.outputs.prefix }}-cp38-cp38-linux_x86_64.whl ./llama_cpp_python-gpu-0.1.53-cp38-cp38-linux_x86_64.whl
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: wheels
path: |
*.whl
release:
needs: build
runs-on: self-hosted
if: github.event_name == 'release'
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: wheels
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
*.whl
token: ${{ secrets.GITHUB_TOKEN }}