-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (108 loc) · 3.15 KB
/
build.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: CI
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
paths:
[
".github/scripts/**",
".github/workflows/build.yml",
"**/CMakeLists.txt",
"**/Makefile",
"**/*.h",
"**/*.hpp",
"**/*.c",
"**/*.cpp",
"**/*.cu",
"**/*.cc",
"**/*.cxx",
"llama.cpp",
"!docs/**",
"!.gitignore",
"!README.md",
]
workflow_dispatch:
jobs:
create-draft-release:
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
version: ${{ steps.get_version.outputs.version }}
permissions:
contents: write
steps:
- name: Extract tag name without v prefix
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV && echo "::set-output name=version::${GITHUB_REF#refs/tags/v}"
env:
GITHUB_REF: ${{ github.ref }}
- name: Create Draft Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: "${{ env.VERSION }}"
draft: true
prerelease: false
build-and-test:
runs-on: ${{ matrix.runs-on }}
needs: [create-draft-release]
timeout-minutes: 40
strategy:
matrix:
include:
- os: "windows"
name: "amd64"
runs-on: "windows-amd"
cmake-flags: ""
run-e2e: true
steps:
- name: Clone
id: checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install make on Windows
if: runner.os == 'windows'
run: |
choco install make -y
- name: Install dependencies
run: |
make install-dependencies
- name: Build onnx runtime
run: |
make build-onnxruntime
- name: Build engine
run: |
make build-engine
- name: Build example server
run: |
make build-example-server
- name: Install Python
if: ${{matrix.run-e2e}}
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Run e2e test
if: ${{matrix.run-e2e}}
run: |
make run-e2e-test
- name: Package
run: |
make package
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: cortex.onnx-${{ matrix.os }}-${{ matrix.name }}
path: ./cortex.onnx
- uses: actions/[email protected]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: ./cortex.onnx.tar.gz
asset_name: cortex.onnx-${{ needs.create-draft-release.outputs.version }}-${{ matrix.os }}-${{ matrix.name }}.tar.gz
asset_content_type: application/gzip