-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (59 loc) · 2.43 KB
/
SVGUpdate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Copyright (c) LieberLieber Software GmbH
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
name: LemonTree.Automation SVG Update in Repo
on:
push:
env:
ModelName: DemoModel
ModelExtension: eapx
SVGFolder: .\svg\
jobs:
SVGUpdateInRepo:
defaults:
run:
shell: pwsh
runs-on: windows-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
# download Lemontree.Automation on a runner and setup the license
- uses: LieberLieber/setup-LemonTree.Automation@v5
id: GetLTA
with:
License: ${{secrets.LTALICENSE}}
#ExeLocation &"${{steps.GetLTA.outputs.LemonTreeAutomationExecutable}}"
- name: PrepareForSVGExport
id: prep
run: |
#Check if the Folder Exists
$folderPath = "${{env.SVGFolder}}"
if (Test-Path $folderPath) {
Write-Output "Folder $folderPath exists"
} else {
Write-Output "Folder $folderPath does not exist, we create it "
New-Item -ItemType Directory -Force -Path $folderPath
}
#delete all SVG files from the Folder - so deletion of diagrams is also reflected in git. existing diagrams will be recreated anyway.
$filesSVG = $folderPath+"*.svg"
Write-Output "deleting files $filesSVG"
Remove-Item "$filesSVG"
Write-Output "filesSVG=$filesSVG" >>$env:GITHUB_OUTPUT
- name: ExportLatestSVGDiagrams
run: |
&"${{steps.GetLTA.outputs.LemonTreeAutomationExecutable}}" SVGExport --Model ${{env.ModelName}}.${{env.ModelExtension}} --DiagramDirectory ${{env.SVGFolder}}
- name: createCommitandPush
run: |
Write-Output "set user config"
git config --global user.name 'LemonTree.Automation'
git config --global user.email '[email protected]'
Write-Output "setting remote state"
git remote set-url origin https://x-access-token:${{secrets.PAT}}@github.com/${{github.repository}}
git add ${{steps.prep.outputs.filesSVG}}
git commit -m "LemonTree.Automation SVG Update"
git push
Write-Output "SVG Updated in Repository"