Generate API Docs #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Generate API Docs | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'VoiceNotesAI.Domain/**' | |
| - 'VoiceNotesAI.Infra/**' | |
| - 'VoiceNotesAI.Infra.Interfaces/**' | |
| workflow_dispatch: | |
| concurrency: | |
| group: wiki | |
| cancel-in-progress: true | |
| env: | |
| DOTNET_VERSION: '8.0.x' | |
| jobs: | |
| generate-docs: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET 8 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Install xmldoc2md | |
| run: dotnet tool install -g XMLDoc2Markdown | |
| - name: Publish library projects | |
| run: | | |
| dotnet publish VoiceNotesAI.Domain/VoiceNotesAI.Domain.csproj -c Release -o publish/Domain | |
| dotnet publish VoiceNotesAI.Infra.Interfaces/VoiceNotesAI.Infra.Interfaces.csproj -c Release -o publish/Infra-Interfaces | |
| dotnet publish VoiceNotesAI.Infra/VoiceNotesAI.Infra.csproj -c Release -o publish/Infra | |
| - name: Generate Markdown documentation | |
| run: | | |
| mkdir -p wiki/Domain wiki/Infra-Interfaces wiki/Infra | |
| xmldoc2md publish/Domain/VoiceNotesAI.Domain.dll \ | |
| --output wiki/Domain --back-button --index-page-name Domain | |
| xmldoc2md publish/Infra-Interfaces/VoiceNotesAI.Infra.Interfaces.dll \ | |
| --output wiki/Infra-Interfaces --back-button --index-page-name Infra-Interfaces | |
| xmldoc2md publish/Infra/VoiceNotesAI.Infra.dll \ | |
| --output wiki/Infra --back-button --index-page-name Infra | |
| - name: Generate Home page | |
| run: | | |
| cat > wiki/Home.md << 'EOF' | |
| # VoiceNotesAI — API Documentation | |
| Documentação gerada automaticamente a partir do código-fonte. | |
| ## Módulos | |
| - [Domain](Domain) — Models, entidades SQLite e helpers | |
| - [Infra.Interfaces](Infra-Interfaces) — Interfaces de serviços e repositórios | |
| - [Infra](Infra) — Implementações de serviços, repositórios e AppDatabase | |
| --- | |
| > Atualizado automaticamente via GitHub Actions a cada push em `main`. | |
| EOF | |
| - name: Deploy to Wiki | |
| uses: actions4gh/deploy-wiki@v1 | |
| with: | |
| path: wiki |