name: Build Llama wheel in Docker on: push: tags: - '*-llama' 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 --build-arg LLAMA_CPP_VERSION=${{ steps.separate.outputs.prefix }} -f Dockerfile-llama-cpp-wheel - name: Run Docker container run: docker run --name my-artifact-builder artifact-builder - 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-${{ steps.separate.outputs.prefix }}-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 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 }}