From ace690cbd82bf51ee4289052e7fe29c740980dc1 Mon Sep 17 00:00:00 2001 From: Laurianti Date: Sat, 26 Sep 2026 07:21:03 +0200 Subject: [PATCH 1/5] Fixed the API references workflow: `xmldoc2md` is run by its command name, with .NET 10 for XMLDoc2Markdown 6 --- .github/workflows/update_api_references.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update_api_references.yml b/.github/workflows/update_api_references.yml index 643b8e94c..503634a6a 100644 --- a/.github/workflows/update_api_references.yml +++ b/.github/workflows/update_api_references.yml @@ -18,13 +18,14 @@ jobs: with: dotnet-version: | 8.0.x + 10.0.x - name: install_tool_and_generate_api_docs run: | dotnet tool install -g XMLDoc2Markdown dotnet build ./LLama/LLamaSharp.csproj cd LLama/bin/Debug/net8.0 rm -rf ../../../../docs/xmldocs - dotnet xmldoc2md LLamaSharp.dll -o ../../../../docs/xmldocs --back-button + xmldoc2md LLamaSharp.dll -o ../../../../docs/xmldocs --back-button - name: Commit and push changes run: | From c17e005ae1bf57fda4b7e7d170b77be4cf65092d Mon Sep 17 00:00:00 2001 From: Laurianti Date: Sat, 26 Sep 2026 07:26:44 +0200 Subject: [PATCH 2/5] Fixed the `xmldoc2md` command in the contributing guide --- docs/ContributingGuide.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/ContributingGuide.md b/docs/ContributingGuide.md index 2d5103e0f..9009d3e16 100644 --- a/docs/ContributingGuide.md +++ b/docs/ContributingGuide.md @@ -111,11 +111,7 @@ For API references, LLamaSharp takes use of [xmldoc2md](https://github.com/charl ``` dotnet tool install -g XMLDoc2Markdown cd LLama/bin/Debug/net8 # change the path to your bin path. -dotnet xmldoc2md LLamaSharp.dll -o ../../../../docs/xmldocs --back-button +xmldoc2md LLamaSharp.dll -o ../../../../docs/xmldocs --back-button ``` -Specifically, if the xmldoc2md cannot be found by dotnet cli, please replace the `dotnet xmldoc2md` with the executable file, like below. - -``` -C:\Users\liu_y\.dotnet\tools\xmldoc2md.exe LLamaSharp.dll -o ../../../../docs/xmldocs --back-button -``` \ No newline at end of file +XMLDoc2Markdown 6 runs on .NET 10, so the .NET 10 runtime needs to be installed as well. \ No newline at end of file From 2889fc801dc457a18240395b2012de79d3104d5f Mon Sep 17 00:00:00 2001 From: Laurianti Date: Sat, 26 Sep 2026 07:37:51 +0200 Subject: [PATCH 3/5] Checked out the pull request's branch, so that the docs commit can be pushed to it --- .github/workflows/update_api_references.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update_api_references.yml b/.github/workflows/update_api_references.yml index 503634a6a..b594a1a62 100644 --- a/.github/workflows/update_api_references.yml +++ b/.github/workflows/update_api_references.yml @@ -14,6 +14,8 @@ jobs: steps: - uses: actions/checkout@v6 + with: + ref: ${{ github.event.pull_request.head.ref }} - uses: actions/setup-dotnet@v4 with: dotnet-version: | From 9cb4392c11ed2d596898bfbdf593e0bac11e5b63 Mon Sep 17 00:00:00 2001 From: Laurianti Date: Sat, 26 Sep 2026 07:50:29 +0200 Subject: [PATCH 4/5] Regenerated the API references after a merge into master, where the push works for pull requests from forks too --- .github/workflows/update_api_references.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update_api_references.yml b/.github/workflows/update_api_references.yml index b594a1a62..d49579d04 100644 --- a/.github/workflows/update_api_references.yml +++ b/.github/workflows/update_api_references.yml @@ -1,21 +1,22 @@ name: Update API references on: - pull_request_review: - types: [submitted] + push: + branches: [master] + paths: ['LLama/**'] concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: update_api_references: - if: github.event.pull_request.base.ref == 'master' && github.event.review.state == 'approved' + if: github.repository == 'SciSharp/LLamaSharp' name: Update API References runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v6 with: - ref: ${{ github.event.pull_request.head.ref }} + token: ${{ secrets.REPO_TOKEN || github.token }} - uses: actions/setup-dotnet@v4 with: dotnet-version: | @@ -44,6 +45,4 @@ jobs: git diff --cached --name-only git commit -m "chore(docs): update API references in the github action." git push - env: - GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} From 82b58be3787d9d5a3ea6e937c9eb78321251fa00 Mon Sep 17 00:00:00 2001 From: Laurianti Date: Sat, 26 Sep 2026 08:03:59 +0200 Subject: [PATCH 5/5] Dropped the pages XMLDoc2Markdown 6 writes for fixed buffer types, whose names Windows cannot check out --- .github/workflows/update_api_references.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/update_api_references.yml b/.github/workflows/update_api_references.yml index d49579d04..fbbcbb65b 100644 --- a/.github/workflows/update_api_references.yml +++ b/.github/workflows/update_api_references.yml @@ -29,6 +29,10 @@ jobs: cd LLama/bin/Debug/net8.0 rm -rf ../../../../docs/xmldocs xmldoc2md LLamaSharp.dll -o ../../../../docs/xmldocs --back-button + # XMLDoc2Markdown 6 also writes the compiler's fixed buffer types, named like e__FixedBuffer, + # which Windows cannot check out + find ../../../../docs/xmldocs -name '*[<>]*' -delete + sed -i '/e__fixedbuffer\.md)/d' ../../../../docs/xmldocs/index.md - name: Commit and push changes run: |