-
Notifications
You must be signed in to change notification settings - Fork 38
103 lines (86 loc) · 3.21 KB
/
release.yml
File metadata and controls
103 lines (86 loc) · 3.21 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build-macos-arm64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DTQ_BUILD_SERVER=ON
cmake --build build --config Release -j$(sysctl -n hw.ncpu)
- name: Package
run: |
mkdir -p quant.cpp-macos-arm64
cp build/quant quant.cpp-macos-arm64/
cp build/quant-server quant.cpp-macos-arm64/
cp LICENSE quant.cpp-macos-arm64/ 2>/dev/null || true
cp README.md quant.cpp-macos-arm64/ 2>/dev/null || true
tar czf quant.cpp-macos-arm64.tar.gz quant.cpp-macos-arm64/
- uses: actions/upload-artifact@v4
with:
name: quant.cpp-macos-arm64
path: quant.cpp-macos-arm64.tar.gz
build-linux-x86_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DTQ_BUILD_SERVER=ON \
-DCMAKE_EXE_LINKER_FLAGS="-static -pthread"
cmake --build build --config Release -j$(nproc)
- name: Package
run: |
mkdir -p quant.cpp-linux-x86_64
cp build/quant quant.cpp-linux-x86_64/
cp build/quant-server quant.cpp-linux-x86_64/
cp LICENSE quant.cpp-linux-x86_64/ 2>/dev/null || true
cp README.md quant.cpp-linux-x86_64/ 2>/dev/null || true
tar czf quant.cpp-linux-x86_64.tar.gz quant.cpp-linux-x86_64/
- uses: actions/upload-artifact@v4
with:
name: quant.cpp-linux-x86_64
path: quant.cpp-linux-x86_64.tar.gz
build-windows-x64:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DTQ_BUILD_SERVER=ON
cmake --build build --config Release -j $env:NUMBER_OF_PROCESSORS
- name: Package
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path quant.cpp-windows-x64
Copy-Item build/Release/quant.exe quant.cpp-windows-x64/
Copy-Item build/Release/quant-server.exe quant.cpp-windows-x64/
if (Test-Path LICENSE) { Copy-Item LICENSE quant.cpp-windows-x64/ }
if (Test-Path README.md) { Copy-Item README.md quant.cpp-windows-x64/ }
Compress-Archive -Path quant.cpp-windows-x64/* -DestinationPath quant.cpp-windows-x64.zip
- uses: actions/upload-artifact@v4
with:
name: quant.cpp-windows-x64
path: quant.cpp-windows-x64.zip
release:
needs: [build-macos-arm64, build-linux-x86_64, build-windows-x64]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: List artifacts
run: find artifacts -type f
- uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
artifacts/quant.cpp-macos-arm64/quant.cpp-macos-arm64.tar.gz
artifacts/quant.cpp-linux-x86_64/quant.cpp-linux-x86_64.tar.gz
artifacts/quant.cpp-windows-x64/quant.cpp-windows-x64.zip