8000 feat: Binary wheels for CPU, CUDA (12.1 - 12.3), Metal (#1247) · xhedit/llama-cpp-conv@3c77e5a · GitHub
[go: up one dir, main page]

Skip to content

Commit 3c77e5a

Browse files
abetlenxhedit
authored andcommitted
feat: Binary wheels for CPU, CUDA (12.1 - 12.3), Metal (abetlen#1247)
* Generate binary wheel index on release * Add total release downloads badge * Update download label * Use official cibuildwheel action * Add workflows to build CUDA and Metal wheels * Update generate index workflow * Update workflow name
1 parent 06f84e0 commit 3c77e5a

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

scripts/release-to-pep-503.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/bash
2+
3+
# Get output directory or default to index/whl/cpu
4+
output_dir=${1:-"index/whl/cpu"}
5+
6+
# Create output directory
7+
mkdir -p $output_dir
8+
9+
# Change to output directory
10+
pushd $output_dir
11+
12+
# Create an index html file
13+
echo "<!DOCTYPE html>" > index.html
14+
echo "<html>" >> index.html
15+
echo " <head></head>" >> index.html
16+
echo " <body>" >> index.html
17+
echo " <a href=\"llama-cpp-python/\">llama-cpp-python</a>" >> index.html
18+
echo " <br>" >> index.html
19+
echo " </body>" >> index.html
20+
echo "</html>" >> index.html
21+
echo "" >> index.html
22+
23+
# Create llama-cpp-python directory
24+
mkdir -p llama-cpp-python
25+
26+
# Change to llama-cpp-python directory
27+
pushd llama-cpp-python
28+
29+
# Create an index html file
30+
echo "<!DOCTYPE html>" > index.html
31+
echo "<html>" >> index.html
32+
echo " <body>" >> index.html
33+
echo " <h1>Links for llama-cpp-python</h1>" >> index.html
34+
35+
# Get all releases
36+
releases=$(curl -s https://api.github.com/repos/abetlen/llama-cpp-python/releases | jq -r .[].tag_name)
37+
38+
# Get pattern from second arg or default to valid python package version pattern
39+
pattern=${2:-"^[v]?[0-9]+\.[0-9]+\.[0-9]+$"}
40+
41+
# Filter releases by pattern
42+
releases=$(echo $releases | tr ' ' '\n' | grep -E $pattern)
43+
44+
# For each release, get all assets
45+
for release in $releases; do
46+
assets=$(curl -s https://api.github.com/repos/abetlen/llama-cpp-python/releases/tags/$release | jq -r .assets)
47+
echo " <h2>$release</h2>" >> index.html
48+
for asset in $(echo $assets | jq -r .[].browser_download_url); do
49+
if [[ $asset == *".whl" ]]; then
50+
echo " <a href=\"$asset\">$asset</a>" >> index.html
51+
echo " <br>" >> index.html
52+
fi
53+
done
54+
done
55+
56+
echo " </body>" >> index.html
57+
echo "</html>" >> index.html
58+
echo "" >> index.html

0 commit comments

Comments
 (0)
0