-
Notifications
You must be signed in to change notification settings - Fork 351
82 lines (69 loc) · 2.63 KB
/
release-patch.yml
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
name: auto-patch-release
on:
workflow_run:
workflows: ["release-patch-trigger"]
types:
- completed
env:
NUGET_API_TOKEN: ${{ secrets.LLAMA_SHARP_NUGET_KEY_REPO }}
jobs:
patch_release_to_nuget:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name Rinne
git config user.email [email protected]
- name: Setup NuGet
uses: nuget/setup-nuget@v1
with:
nuget-api-key: $NUGET_API_TOKEN
nuget-version: 'latest'
- name: Check .NET info
run: dotnet --info
- name: Install dependencies
run: dotnet restore
- name: Build solution
run: |
dotnet build ./LLama/LLamaSharp.csproj -c Release --no-restore
dotnet build ./LLama.SemanticKernel/LLamaSharp.SemanticKernel.csproj -c Release --no-restore
dotnet build ./LLama.KernelMemory/LLamaSharp.KernelMemory.csproj -c Release --no-restore
- name: Pack packages
run: |
git fetch --unshallow;
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*";
git fetch origin;
chmod +x ./.github/prepare_release.sh
./.github/prepare_release.sh false true
- name: Upload packages artifacts
uses: actions/upload-artifact@v4
with:
name: "drop-ci-packages"
path: './temp'
- name: Push LLamaSharp packages to nuget.org
run: dotnet nuget push ./temp/LLamaSharp*.nupkg --source https://www.nuget.org -k ${{ secrets.LLAMA_SHARP_NUGET_KEY_REPO }} --skip-duplicate
# Deploy the documentation to GitHub Pages
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs==1.4.3 mkdocs-material mike==1.1.2 setuptools
- run: |
git fetch origin gh-pages --depth=1
version=$(cat ./temp/version.txt)
mike deploy --push --update-aliases --force $version latest
mike set-default --push --force latest
# Upload the native binaries to huggingface (experimental)
- name: Upload native binaries to huggingface
run: |
pip install huggingface_hub
llama_cpp_commit_hash=$(git submodule status llama.cpp | cut -c 2-7)
python .github/upload_to_hf.py --token ${{ secrets.HUGGINGFACE_TOKEN }} --revision $llama_cpp_commit_hash --folder LLama/runtimes