Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3dd2616

Browse filesBrowse files
committed
Generate binary wheel index on release
1 parent 87a6e57 commit 3dd2616
Copy full SHA for 3dd2616

File tree

Expand file treeCollapse file tree

2 files changed

+86
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+86
-0
lines changed
+61Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Deploy static content to Pages
2+
3+
on:
4+
# Trigger on any new release
5+
release:
6+
types: [published]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
18+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
19+
concurrency:
20+
group: "pages"
21+
cancel-in-progress: false
22+
23+
jobs:
24+
# Single deploy job since we're just deploying
25+
deploy:
26+
environment:
27+
name: github-pages
28+
url: ${{ steps.deployment.outputs.page_url }}
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
- name: Setup Pages
34+
uses: actions/configure-pages@v4
35+
- name: Build
36+
run: |
37+
mkdir index
38+
mkdir index/whl
39+
mkdir index/whl/cpu
40+
mkdir index/whl/cpu/llama-cpp-python
41+
42+
echo "<!DOCTYPE html>" > index.html
43+
echo "<html>" >> index.html
44+
echo " <head></head>" >> index.html
45+
echo " <body>" >> index.html
46+
echo " <a href=\"llama-cpp-python/\">llama-cpp-python</a>" >> index.html
47+
echo " <br>"
48+
echo " </body>" >> index.html
49+
echo "</html>" >> index.html
50+
51+
cp index.html index/whl/cpu/index.html
52+
53+
./scripts/release-to-pypi-index.sh > index/whl/cpu/llama-cpp-python/index.html
54+
- name: Upload artifact
55+
uses: actions/upload-pages-artifact@v3
56+
with:
57+
# Upload entire repository
58+
path: 'index'
59+
- name: Deploy to GitHub Pages
60+
id: deployment
61+
uses: actions/deploy-pages@v4

‎scripts/release-to-pypi-index.sh

Copy file name to clipboard
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
# Create an index html file
4+
echo "<!DOCTYPE html>"
5+
echo "<html>"
6+
echo " <body>"
7+
echo " <h1>Links for llama-cpp-python</h1>"
8+
9+
# Get all releases
10+
releases=$(curl -s https://api.github.com/repos/abetlen/llama-cpp-python/releases | jq -r .[].tag_name)
11+
12+
# For each release, get all assets
13+
for release in $releases; do
14+
assets=$(curl -s https://api.github.com/repos/abetlen/llama-cpp-python/releases/tags/$release | jq -r .assets)
15+
echo " <h2>$release</h2>"
16+
for asset in $(echo $assets | jq -r .[].browser_download_url); do
17+
if [[ $asset == *".whl" ]]; then
18+
echo " <a href=\"$asset\">$asset</a>"
19+
echo " <br>"
20+
fi
21+
done
22+
done
23+
24+
echo " </body>"
25+
echo "</html>"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.