Skip to content

Commit e0c2d6f

Browse files
authored
Merge pull request #1214 from AsakusaRinne/add_xml_update_ci
ci: add action to update the api references.
2 parents dd65cc5 + d27458d commit e0c2d6f

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Update API references
2+
on:
3+
pull_request_review:
4+
types: [submitted]
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
update_api_references:
11+
if: github.event.pull_request.base.ref == 'master' && github.event.review.state == 'approved'
12+
name: Update API References
13+
runs-on: ubuntu-22.04
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-dotnet@v4
18+
with:
19+
dotnet-version: |
20+
8.0.x
21+
- name: install_tool_and_generate_api_docs
22+
run: |
23+
dotnet tool install -g XMLDoc2Markdown
24+
dotnet build ./LLama/LLamaSharp.csproj
25+
cd LLama/bin/Debug/net8.0
26+
rm -rf ../../../../docs/xmldocs
27+
dotnet xmldoc2md LLamaSharp.dll -o ../../../../docs/xmldocs --back-button
28+
29+
- name: Commit and push changes
30+
run: |
31+
git config --global user.name "github-actions[bot]"
32+
git config --global user.email "[email protected]"
33+
git add docs/xmldocs
34+
if git diff --cached --quiet; then
35+
echo "No changes to commit."
36+
exit 0
37+
fi
38+
echo "Current git status:"
39+
git status
40+
echo "Modified files:"
41+
git diff --cached --name-only
42+
git commit -m "chore(docs): update API references in the github action."
43+
git push
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
46+

0 commit comments

Comments
 (0)