| | name: Build GGML wheel in Docker |
| |
|
| | on: |
| | push: |
| | tags: |
| | - '*-ggml' |
| |
|
| | 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 CTRANSFORMERS_VERSION=${{ steps.separate.outputs.prefix }} -f Dockerfile-ggml-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/dist/ctransformers-${{ steps.separate.outputs.prefix }}-cp38-cp38-linux_x86_64.whl ./ctransformers-${{ 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 |
| | 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 }} |
| |
|