-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (99 loc) · 3.58 KB
/
build.yml
File metadata and controls
125 lines (99 loc) · 3.58 KB
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
123
124
125
name: build-release
on:
push
permissions:
contents: write
jobs:
build_linux:
runs-on: ubuntu-20.04
steps:
- name: Prepare CUDA
uses: Jimver/cuda-toolkit@v0.2.15
id: cuda-toolkit
with:
cuda: '12.4.1'
method: network
- name: Verify CUDA
run: |
echo "Installed cuda version is: ${{steps.cuda-toolkit.outputs.cuda}}"
echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
nvcc -V
- name: chekout
uses: actions/checkout@v4
# - name: clone git submodules
# run: git submodule update --init --recursive
- name: cmake configure
run: cmake -B build -DUSE_CUDA=1 -DCMAKE_BUILD_TYPE=Release
- name: build
run: cmake --build build --target install -j 8
- name: tar target
run: tar -czf CodeInferflow-linux-x64-CUDA-${{steps.cuda-toolkit.outputs.cuda}}.tar.gz bin/ data/ README.md docs/
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: CodeInferflow-linux-x64-CUDA-${{steps.cuda-toolkit.outputs.cuda}}.tar.gz
path: CodeInferflow-linux-x64-CUDA-${{steps.cuda-toolkit.outputs.cuda}}.tar.gz
build_windows:
runs-on: windows-2022
steps:
- name: "Prepare CUDA"
uses: Jimver/cuda-toolkit@v0.2.15
id: cuda-toolkit
with:
cuda: '12.4.1'
method: network
- name: Verify CUDA
run: |
echo "Installed cuda version is: ${{steps.cuda-toolkit.outputs.cuda}}"
echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
nvcc -V
- name: chekout
uses: actions/checkout@v4
# - name: clone git submodules
# run: git submodule update --init --recursive
- name: cmake configure
run: cmake -B build -DUSE_CUDA=1 -DCMAKE_BUILD_TYPE=Release
- name: build
run: cmake --build build --target install --config release
- name: zip target
run: 7z a CodeInferflow-win-x64-CUDA-${{steps.cuda-toolkit.outputs.cuda}}.zip bin/ data/ README.md docs/
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: CodeInferflow-win-x64-CUDA-${{steps.cuda-toolkit.outputs.cuda}}.zip
path: CodeInferflow-win-x64-CUDA-${{steps.cuda-toolkit.outputs.cuda}}.zip
release:
if: startsWith(github.ref, 'refs/tags/')
needs:
- build_linux
- build_windows
runs-on: ubuntu-latest
steps:
- name: chekout
uses: actions/checkout@v4
- name: Extract tag name
id: get_tag
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
# run: echo "::set-output name=TAG_NAME::"
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: release
merge-multiple: true
- name: list dir
run: ls release -l
- name: add tags to release files name
run: |
for file in release/*.tar.gz; do
mv $file release/`basename -s .tar.gz $file`-${{ steps.get_tag.outputs.TAG_NAME }}.tar.gz
done
for file in release/*.zip; do
mv $file release/`basename -s .zip $file`-${{ steps.get_tag.outputs.TAG_NAME }}.zip
done
- name: list release
run: ls release -l
- name: create github release
uses: ncipollo/release-action@v1
with:
artifacts: release/*
bodyFile: docs/release-notes/v${{ steps.get_tag.outputs.TAG_NAME }}.md