File size: 1,325 Bytes
1cf2abd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: build

on:
  push:
    paths:
      - 'models/**'
      - CMakeLists.txt
    branches:
      - main
    tags-ignore:
      - '**'
  workflow_dispatch:

jobs:
  build:
    name: ${{ matrix.os }} ${{ matrix.instructions }}
    runs-on: ${{ matrix.os }}

    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-20.04
          - macos-latest
          - windows-latest
        instructions:
          - avx2
          - avx
          - basic

    steps:
      - uses: actions/checkout@v3

      - name: Build
        run: |
          cmake -B build -DCT_INSTRUCTIONS=${{ matrix.instructions }}
          cmake --build build --config Release

          mkdir tmp
          mv build/lib tmp/${{ matrix.instructions }}

      - uses: actions/upload-artifact@v3
        with:
          name: libraries
          path: tmp
          if-no-files-found: error

  finish:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          ssh-key: ${{ secrets.DEPLOY_KEY }}

      - uses: actions/download-artifact@v3
        with:
          name: libraries
          path: ctransformers/lib

      - uses: git-actions/set-user@v1

      - name: Save
        run: |
          git add ctransformers/lib
          git commit -m 'Auto Build'
          git push