char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Aleksander Grygierci: Clean up UI builds from releases (#27706)4d19b2876

char/aliceai-t5-moe
2.4 KiB75 linesraw
1name: UI Publish
2
3on:
4  workflow_call:
5    inputs:
6      version_tag:
7        description: 'Version tag to publish under (e.g., b1234)'
8        required: true
9        type: string
10    secrets:
11      hf_token:
12        description: 'Hugging Face token with write access'
13        required: true
14
15jobs:
16  build:
17    name: Build static output
18    uses: ./.github/workflows/ui-build.yml
19
20  publish:
21    name: Publish UI Static Output
22    needs: build
23    runs-on: ubuntu-slim
24
25    permissions:
26      contents: read
27
28    env:
29      HF_BUCKET_NAME: ${{ vars.HF_BUCKET_UI_STATIC_OUTPUT }}
30
31    steps:
32      - name: Checkout code
33        uses: actions/checkout@v6
34        with:
35          fetch-depth: 1
36
37      - name: Download UI build artifact
38        uses: actions/download-artifact@v7
39        with:
40          name: llama-ui.zip
41          path: tools/ui/dist/
42
43      - name: Create distribution archive
44        run: |
45          tar -czf dist.tar.gz -C tools/ui/dist .
46          sha256sum dist.tar.gz > dist.tar.gz.sha256
47          mv dist.tar.gz dist.tar.gz.sha256 tools/ui/dist/
48
49      - name: Install Hugging Face Hub CLI
50        run: pip install -U huggingface_hub
51
52      - name: Authenticate with Hugging Face
53        run: hf auth login --token ${{ secrets.hf_token }}
54
55      - name: Sync built files to Hugging Face bucket (version tag)
56        run: |
57          # Upload the built files to the Hugging Face bucket under the release version
58          hf buckets sync tools/ui/dist hf://buckets/ggml-org/${{ env.HF_BUCKET_NAME }}/${{ inputs.version_tag }} --delete --quiet
59
60      - name: Sync built files to Hugging Face bucket (latest)
61        run: |
62          # Also upload to the 'latest' directory for fallback downloads
63          hf buckets sync tools/ui/dist hf://buckets/ggml-org/${{ env.HF_BUCKET_NAME }}/latest --delete --quiet
64
65      - name: Verify upload
66        run: |
67          # List the files in the bucket to verify the upload
68          hf buckets list hf://buckets/ggml-org/${{ env.HF_BUCKET_NAME }}/${{ inputs.version_tag }} -R -h
69
70      - name: Clean up root-level files
71        run: |
72          # Clean up any old root-level files from previous non-versioned deployments
73          hf buckets rm ggml-org/${{ env.HF_BUCKET_NAME }}/index.html --yes 2>/dev/null || true
74          hf buckets rm ggml-org/${{ env.HF_BUCKET_NAME }}/bundle.js --yes 2>/dev/null || true
75          hf buckets rm ggml-org/${{ env.HF_BUCKET_NAME }}/bundle.css --yes 2>/dev/null || true