Generate UML #19
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 | |
| workflow_dispatch: | |
| jobs: | |
| generate-uml: | |
| name: 'Generate UML' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| env: | |
| CODE_PATH: "./Assets/Scripts/" | |
| UML_OUTPUT_PATH: "./UML/" | |
| UMP_GENERATION_PARAMETERS: -allInOne | |
| steps: | |
| - uses: actions/checkout@v2 | |
| # 1. SETUP JAVA AND .NET | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: 8.0.x | |
| # 2. INSTALL AND GENERATE PLANTUML FILES | |
| - name: Generate PlantUML files | |
| run: | | |
| dotnet tool install --global PlantUmlClassDiagramGenerator --version 1.4.0 | |
| puml-gen ${{ env.CODE_PATH }} ${{ env.UML_OUTPUT_PATH }} -dir ${{ env.UMP_GENERATION_PARAMETERS }} | |
| # 3. CONVERT PUML TO SVG (FIXED: Using the stable SourceForge link) | |
| - name: Generate SVG Diagrams (Direct Execution) | |
| run: | | |
| # 3a. Download the latest PlantUML JAR file from a stable source | |
| wget https://downloads.sourceforge.net/project/plantuml/plantuml.jar -O plantuml.jar | |
| # 3b. Run the JAR file to process all .puml files into .svg | |
| java -jar plantuml.jar -tsvg ${{ env.UML_OUTPUT_PATH }}*.puml -o ${{ env.UML_OUTPUT_PATH }} | |
| # 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 | |
| add: ${{ env.UML_OUTPUT_PATH }}. |