Generate UML #7
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 UML | |
| on: | |
| push: | |
| branches: | |
| - master # Or 'main', depending on your branch name | |
| workflow_dispatch: | |
| jobs: | |
| generate-uml: | |
| name: 'Generate UML' | |
| runs-on: ubuntu-latest | |
| env: | |
| CODE_PATH: "./Assets/Scripts/" # <-- Verify this path is correct | |
| UML_OUTPUT_PATH: "./UML/" # <-- Verify this path is desired | |
| UMP_GENERATION_PARAMETERS: -createAssociation -allInOne | |
| steps: | |
| - uses: actions/checkout@v2 | |
| # 1. SETUP .NET (FIXED: Updated to v3 and 8.0.x for stability/compatibility) | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| # Using 8.0.x to ensure compatibility with the modern tool version (1.4.0) | |
| dotnet-version: 8.0.x | |
| # 2. INSTALL AND GENERATE PLANTUML FILES (FIXED: Corrected tool version to 1.4.0) | |
| - name: Generate PlantUML files | |
| run: | | |
| # Install the generator tool with the latest stable version found on NuGet | |
| dotnet tool install --global PlantUmlClassDiagramGenerator --version 1.4.0 | |
| # Run the generator | |
| puml-gen ${{ env.CODE_PATH }} ${{ env.UML_OUTPUT_PATH }} -dir ${{ env.UMP_GENERATION_PARAMETERS }} | |
| # 3. CONVERT PUML TO SVG (User's preferred action and path are preserved) | |
| - name: Generate SVG Diagrams | |
| uses: Timmy/plantuml-action@v1 | |
| with: | |
| # This converts all .puml files in the output directory | |
| path: ${{ env.UML_OUTPUT_PATH }}*.puml | |
| args: -tsvg # Generates SVG files | |
| # 4. Commit and Push Changes | |
| - uses: EndBug/add-and-commit@v7.0.0 | |
| with: | |
| author_name: 'UML Bot' | |
| message: 'Generate UML (${{ github.workflow }})' | |
| author_email: 41898282+uml-bot[bot]@users.noreply.github.com | |
| files: ${{ env.UML_OUTPUT_PATH }} # Only commit files in the UML folder |