winget.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. steps:
  11. - name: Install cargo binstall
  12. uses: cargo-bins/cargo-binstall@268643a6b5ea099f5718ee5cd3ff7dc89a5eb49b
  13. - name: Install komac
  14. run: |
  15. cargo binstall komac@2.11.2 -y
  16. - name: Find latest release
  17. id: find_latest_release
  18. uses: actions/github-script@v6
  19. with:
  20. script: |
  21. const { data: releases } = await github.rest.repos.listReleases({
  22. owner: context.repo.owner,
  23. repo: context.repo.repo,
  24. });
  25. console.log("Latest release:", releases[0].tag_name);
  26. return releases[0].tag_name;
  27. - name: Update manifest
  28. env:
  29. VERSION: ${{ steps.find_latest_release.outputs.result }}
  30. run: |
  31. echo "Updating manifest..."
  32. komac update --version ${{ env.VERSION }} \
  33. --urls "https://github.com/ggml-org/llama.cpp/releases/download/${{ env.VERSION }}/llama-${{ env.VERSION }}-bin-win-vulkan-x64.zip" \
  34. --token ${{ secrets.WINGET_GITHUB_TOKEN }} \
  35. --submit \
  36. ggml.llamacpp