Skip to content

Generate UML

Generate UML #4

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/" # <-- Check this path is correct
UML_OUTPUT_PATH: "./UML/" # <-- Check this path is desired
UMP_GENERATION_PARAMETERS: -createAssociation -allInOne
steps:
- uses: actions/checkout@v2
# 1. Setup .NET (Required for the C# PlantUML tool)
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x # Use 5.0.x as specified in the original
# 2. Install and Generate PlantUML Files (puml-gen)
# This step handles the check for code existence implicitly.
- name: Generate PlantUML files
run: |
# Install the generator tool
dotnet tool install --global PlantUmlClassDiagramGenerator --version 1.2.4
# Run the generator
puml-gen ${{ env.CODE_PATH }} ${{ env.UML_OUTPUT_PATH }} -dir ${{ env.UMP_GENERATION_PARAMETERS }}
# The tool will exit gracefully if CODE_PATH is empty
# 3. CONVERT PUML TO SVG/PNG (THE FIX!)
- name: PlantUML Action
# We use a reliable, alternative action here
uses: Timmy/plantuml-action@v1
with:
# This tells the new action to convert 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