Skip to content

Commit 3fbf3a4

Browse files
authored
ci: only trigger cuda release for current version. (#85)
1 parent af29f32 commit 3fbf3a4

2 files changed

Lines changed: 179 additions & 0 deletions

File tree

File renamed without changes.
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
name: Release Packages
2+
# docker download mirror should setup in self host machine.
3+
# the mirror status can be found at : https://status.daocloud.io/status/docker
4+
on:
5+
push:
6+
tags:
7+
- 'v[0-9]+.[0-9]+.[0-9]+'
8+
workflow_dispatch:
9+
10+
# Needed to create release and upload assets
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
build-tgz:
16+
strategy:
17+
matrix:
18+
arch: [X64]
19+
image: ["dev-centos7-cu124:v1"]
20+
enable_cuda: [1]
21+
22+
runs-on: [self-hosted, Linux, "${{ matrix.arch }}"]
23+
container:
24+
image: dashinfer/${{ matrix.image }}
25+
env:
26+
# force use node16 instead of node20
27+
# otherwise it may cause GLIBCXX_2.27 not found
28+
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
29+
ENABLE_CUDA: ${{ matrix.enable_cuda }}
30+
defaults:
31+
run:
32+
shell: bash -l {0}
33+
steps:
34+
- name: Check out code
35+
uses: actions/checkout@v3
36+
with:
37+
lfs: false
38+
39+
- name: Pull LFS
40+
run: |
41+
git lfs install --force
42+
git lfs pull
43+
44+
- name: Init submodule
45+
run: |
46+
git submodule init
47+
git submodule update
48+
49+
- name: Build tgz package
50+
shell: bash
51+
run: |
52+
source /root/.bashrc
53+
if [ -f "/miniconda/etc/profile.d/conda.sh" ]; then
54+
source /miniconda/etc/profile.d/conda.sh
55+
fi
56+
source activate ds_py
57+
58+
git fetch --tags
59+
TAG_NAME=$(git describe --tags $(git rev-list --tags --max-count=1))
60+
VERSION_NUMBER=$(echo "$TAG_NAME" | sed 's/^v//')
61+
62+
export AS_RELEASE_VERSION=$VERSION_NUMBER
63+
export AS_BUILD_PACKAGE=ON
64+
65+
echo "ENABLE_CUDA value: $ENABLE_CUDA"
66+
67+
# export ENABLE_MULTINUMA="ON"
68+
if [[ "${{ matrix.arch }}" == "ARM64" ]]; then
69+
export AS_PLATFORM="armclang"
70+
bash build.sh
71+
else
72+
if [ "$ENABLE_CUDA" -eq "1" ];
73+
then
74+
export AS_PLATFORM="cuda"
75+
export AS_CUDA_SM="'70;75;80;86;89;90a'"
76+
bash scripts/release/cpp_build_cuda.sh
77+
else
78+
export AS_PLATFORM="x86"
79+
bash build.sh
80+
fi
81+
fi
82+
83+
- name: Upload tgz package
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: dashinfer-tgz-${{ matrix.arch }}-${{ matrix.enable_cuda }}
87+
path: build/*.tar.gz
88+
89+
90+
build-wheels:
91+
strategy:
92+
matrix:
93+
arch: [X64]
94+
image: ["dev-centos7-cu124:v1"]
95+
enable_cuda: [1]
96+
runs-on: [self-hosted, Linux, "${{ matrix.arch }}"]
97+
container:
98+
image: dashinfer/${{ matrix.image }}
99+
env:
100+
# force use node16 instead of node20
101+
# otherwise it may cause GLIBCXX_2.27 not found
102+
# ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
103+
ENABLE_CUDA: ${{ matrix.enable_cuda }}
104+
steps:
105+
- name: Check out code
106+
uses: actions/checkout@v3
107+
with:
108+
lfs: false
109+
110+
- name: Pull LFS
111+
run: |
112+
git lfs install --force
113+
git lfs pull
114+
115+
- name: Init submodule
116+
run: |
117+
git submodule init
118+
git submodule update
119+
120+
- name: Build manylinux wheels
121+
shell: bash
122+
run: |
123+
source /root/.bashrc
124+
if [ -f "/miniconda/etc/profile.d/conda.sh" ]; then
125+
source /miniconda/etc/profile.d/conda.sh
126+
fi
127+
128+
git fetch --tags
129+
TAG_NAME=$(git describe --tags $(git rev-list --tags --max-count=1))
130+
VERSION_NUMBER=$(echo "$TAG_NAME" | sed 's/^v//')
131+
132+
export AS_RELEASE_VERSION=$VERSION_NUMBER
133+
134+
echo "ENABLE_CUDA value: $ENABLE_CUDA"
135+
136+
if [[ "${{ matrix.arch }}" == "ARM64" ]]; then
137+
bash scripts/release/python_manylinux_build.sh
138+
else
139+
if [ "$ENABLE_CUDA" -eq "1" ];
140+
then
141+
export AS_PLATFORM="cuda"
142+
export AS_CUDA_SM="'70;75;80;86;89;90a'"
143+
bash scripts/release/python_manylinux_build_cuda.sh
144+
else
145+
bash scripts/release/python_manylinux_build.sh
146+
fi
147+
fi
148+
149+
- name: Upload wheels
150+
uses: actions/upload-artifact@v4
151+
with:
152+
name: python-manylinux-wheels-${{ matrix.arch }}-${{ matrix.enable_cuda }}
153+
path: python/wheelhouse/*-manylinux*.whl
154+
155+
publish:
156+
runs-on: [self-hosted, Linux]
157+
needs: [build-tgz, build-wheels]
158+
strategy:
159+
matrix:
160+
arch: [X64]
161+
enable_cuda: [1]
162+
163+
steps:
164+
- name: Download tgz packages
165+
uses: actions/download-artifact@v4
166+
with:
167+
name: dashinfer-tgz-${{ matrix.arch }}-${{ matrix.enable_cuda }}
168+
path: release/
169+
170+
- name: Download python wheels
171+
uses: actions/download-artifact@v4
172+
with:
173+
name: python-manylinux-wheels-${{ matrix.arch }}-${{ matrix.enable_cuda }}
174+
path: release/
175+
176+
- name: Release all packages
177+
uses: softprops/action-gh-release@v1
178+
with:
179+
files: release/*

0 commit comments

Comments
 (0)