Skip to content

Commit

Permalink
ci: add kiota github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Aethylea committed Sep 8, 2024
1 parent bb74a80 commit f17f7af
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/kiota.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Generate Kiota client
run-name: Generate Kiota client
on: [push]
permissions:
contents: write
jobs:
Generate-Kiota-Client:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- uses: actions/checkout@v3

- name: Build Project
run: dotnet build WebApiKiota
working-directory: src

- uses: microsoft/[email protected]

- name: Install Swagger
run: dotnet tool install --create-manifest-if-needed Swashbuckle.AspNetCore.Cli

- name: Generate OpenAPI yaml
run: dotnet swagger tofile --output ${{ github.workspace }}/docs/openapi.yml --yaml ${{ github.workspace }}/src/SkyHope.LibraryManager.WebApi/bin/Debug/net8.0/SkyHope.LibraryManager.WebApi.dll v1

- name: Commit OpenAPI yaml
run: |
git config --global user.name 'Sky Hope'
git config --global user.email '[email protected]'
if git status | grep "docs/openapi.yml"; then
git add ${{ github.workspace }}/docs/openapi.yml
git commit -m "ci: Updated OpenAPI yaml"
git push;
fi;
- name: Update kiota clients in the repository
run: kiota update -o ./SkyHope.LibraryManager.WebApiClient
working-directory: src

- name: Commit Kiota client
run: |
rm ${{ github.workspace }}/.config/dotnet-tools.json
if ! git status | grep "nothing to commit"; then
git add ${{ github.workspace }}/src/\*
git commit -m "ci: Updated Kiota client"
git push;
fi;

0 comments on commit f17f7af

Please sign in to comment.