-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (84 loc) · 3 KB
/
release.yml
File metadata and controls
97 lines (84 loc) · 3 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
name: Release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
build:
name: Build Release Artifacts
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup GCC and CUDA
run: |
sudo apt-get update
sudo apt-get install -y gcc-10 g++-10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 100
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
if command -v nvcc >/dev/null 2>&1; then
nvcc --version
elif [ -d "/usr/local/cuda" ]; then
echo "CUDA_HOME=/usr/local/cuda" >> "$GITHUB_ENV"
echo "/usr/local/cuda/bin" >> "$GITHUB_PATH"
echo "CUDACXX=/usr/local/cuda/bin/nvcc" >> "$GITHUB_ENV"
nvcc --version
elif [ -d "/usr/lib/nvidia-cuda-toolkit" ]; then
echo "CUDA_HOME=/usr/lib/nvidia-cuda-toolkit" >> "$GITHUB_ENV"
echo "/usr/lib/nvidia-cuda-toolkit/bin" >> "$GITHUB_PATH"
echo "CUDACXX=/usr/lib/nvidia-cuda-toolkit/bin/nvcc" >> "$GITHUB_ENV"
nvcc --version
else
sudo apt-get install -y nvidia-cuda-toolkit
echo "CUDA_HOME=/usr/lib/nvidia-cuda-toolkit" >> "$GITHUB_ENV"
echo "/usr/lib/nvidia-cuda-toolkit/bin" >> "$GITHUB_PATH"
echo "CUDACXX=/usr/lib/nvidia-cuda-toolkit/bin/nvcc" >> "$GITHUB_ENV"
nvcc --version
fi
- name: Configure CMake
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CUDA_HOST_COMPILER=/usr/bin/g++-10 \
-DBUILD_TESTS=ON
- name: Build
run: cmake --build build -j"$(nproc)"
- name: Run tests
run: ctest --test-dir build --output-on-failure --timeout 300
- name: Package release
run: |
version="${GITHUB_REF#refs/tags/}"
mkdir -p release
cp build/tiny_llm_demo release/ 2>/dev/null || true
cp -r include release/
cp CMakeLists.txt release/
tar -czf "tiny-llm-${version}-linux-x64.tar.gz" -C release .
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release-artifacts
path: tiny-llm-*.tar.gz
retention-days: 7
publish:
name: Publish Release
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: release-artifacts
path: ./artifacts
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
files: artifacts/*.tar.gz
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}