winget.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. name: Update Winget Package
  2. on:
  3. workflow_dispatch: # allows manual triggering
  4. schedule:
  5. - cron: '28 5 * * *' # Update every day at 5:28 UTC
  6. jobs:
  7. update:
  8. name: Update Winget Package
  9. runs-on: ubuntu-latest
  10. if: ${{ github.repository.owner.login == 'ggml-org' }}
  11. steps:
  12. - name: Install cargo binstall
  13. uses: cargo-bins/cargo-binstall@268643a6b5ea099f5718ee5cd3ff7dc89a5eb49b
  14. - name: Install komac
  15. run: |
  16. cargo binstall komac@2.11.2 -y
  17. - name: Find latest release
  18. id: find_latest_release
  19. uses: actions/github-script@v6
  20. with:
  21. script: |
  22. const { data: releases } = await github.rest.repos.listReleases({
  23. owner: context.repo.owner,
  24. repo: context.repo.repo,
  25. });
  26. console.log("Latest release:", releases[0].tag_name);
  27. return releases[0].tag_name;
  28. - name: Update manifest
  29. env:
  30. VERSION: ${{ steps.find_latest_release.outputs.result }}
  31. run: |
  32. echo "Updating manifest..."
  33. komac update --version ${{ env.VERSION }} \
  34. --urls "https://github.com/ggml-org/llama.cpp/releases/download/${{ env.VERSION }}/llama-${{ env.VERSION }}-bin-win-vulkan-x64.zip" \
  35. --token ${{ secrets.WINGET_GITHUB_TOKEN }} \
  36. --submit \
  37. ggml.llamacpp