Skip to content

Commit

Permalink
Modernize (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor authored Aug 22, 2024
1 parent 76fcb1e commit ad5783e
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 36 deletions.
79 changes: 53 additions & 26 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,86 @@
name: Build
on: [push, pull_request]
on:
pull_request:
push:
branches:
main
concurrency:
group: "${{ github.workflow }}-${{ github.head_ref || github.ref }}"
cancel-in-progress: true
jobs:
ctan:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: release.sh
uses: dante-ev/latex-action@latest
# We need java, pandoc, and more, which is not provided directly by the image
uses: dante-ev/latex-action@edge
with:
entrypoint: ./release.sh
- uses: actions/upload-artifact@v4
with:
name: ctan
path: plantuml.tar.gz
build_and_publish:
build_and_ghpages:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: example-minimal
uses: dante-ev/latex-action@latest
- uses: actions/setup-java@v4
with:
root_file: example-minimal.tex
compiler: lualatex
args: -interaction=nonstopmode -shell-escape
- name: example-class-relations--svg
uses: dante-ev/latex-action@latest
distribution: 'temurin'
java-version: '21'
- name: Cache PlantUML jar
id: cache-plantuml
uses: actions/cache@v4
with:
root_file: example-class-relations--svg.tex
compiler: lualatex
args: -interaction=nonstopmode -shell-escape
- name: example-class-relations--latex
uses: dante-ev/latex-action@latest
path: /tmp/plantuml
key: plantuml-asl-1.2024.6.jar
- name: wget PlantUML jar
if: steps.cache-plantuml.outputs.cache-hit != 'true'
run: |
mkdir /tmp/plantuml
cd /tmp/plantuml
wget https://github.com/plantuml/plantuml/releases/download/v1.2024.6/plantuml-asl-1.2024.6.jar
- name: Set PLANTUML_JAR
run: echo "PLANTUML_JAR=/tmp/plantuml/plantuml-asl-1.2024.6.jar" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
root_file: example-class-relations--latex.tex
compiler: lualatex
args: -interaction=nonstopmode -shell-escape
- name: example-component-diagram
uses: dante-ev/latex-action@latest
packages: graphviz inkscape
version: 1.0
execute_install_scripts: true
- run: dpkg -L inkscape
- run: which inkscape
- name: Install TeX Live
uses: zauguin/install-texlive@v3
with:
root_file: example-component-diagram.tex
compiler: lualatex
args: -interaction=nonstopmode -shell-escape
package_file: tl_packages
- name: example-minimal
run: lualatex -shell-escape example-minimal.tex
- name: example-class-relations--latex
run: lualatex -shell-escape example-class-relations--latex
- name: example-class-relations--svg
run: lualatex -shell-escape example-class-relations--svg
- name: example-component-diagram
run: lualatex -shell-escape example-component-diagram
- name: example-multiple-diagrams-svg
run: lualatex -shell-escape example-multiple-diagrams-svg
- name: Gather build artifacts
run: |
mkdir build
mv example-*.pdf build/
mv example-*.png build/
cp -r README.md .github/_config.yml build/
- name: Publish to GitHub pages
if: success() && github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main'
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages
build_dir: build/
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
if: github.ref != 'refs/heads/main'
with:
name: gh-pages
path: build/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Check [issue #1](https://github.com/koppor/plantuml/issues/1) for the current st

1. Environment variable `PLANTUML_JAR` set to the location of `plantuml.jar`.
You get it from <https://sourceforge.net/projects/plantuml/files/plantuml.jar/download>.
2. Enviroment variable `GRAPHVIZ_DOT` set to the location of `dot.exe`.
2. Windows: Environment variable `GRAPHVIZ_DOT` set to the location of `dot.exe`.
Example: `C:\Program Files (x86)\Graphviz2.38\bin\dot.exe`.
You can install graphviz using `choco install graphviz`.
3. lualatex available with command line parameter `-shell-escape` included.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
\documentclass{scrartcl}

\usepackage{graphics}
% Enables inclusion of SVG graphics - 1:1 approach
% This is NOT the approach of https://ctan.org/pkg/svg-inkscape
% which allows text in SVG to be typeset using LaTeX.
% We just include the SVG as is.

\usepackage{epstopdf}
\epstopdfDeclareGraphicsRule{.svg}{pdf}{.pdf}{%
inkscape #1 --export-filename=\OutputFile
Expand All @@ -22,24 +19,24 @@
[component 1] as c1
[component 2] as c2
[component 3] as c3

c1 -- I2
c1 -- I3

I2 )-- c2
I3 )-- c3
@enduml
\end{plantuml}

\newpage

\begin{plantuml}
@startuml
class Car

Driver - Car : drives >
Car *- Wheel : have 4 >
Car -- Person : < owns
@enduml
\end{plantuml}
\end{document}
\end{document}
37 changes: 37 additions & 0 deletions tl_packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

# Proudly generated by the Island of TeX's DEPendency Printer https://gitlab.com/islandoftex/texmf/depp
adjustbox
cm
collectbox
ctablestack
epstopdf-pkg
fancyvrb
graphics
graphics-cfg
graphics-def
grfext
ifoddpage
iftex
infwarerr
koma-script
kvdefinekeys
kvoptions
kvsetkeys
l3backend
l3kernel
l3packages
latex
latex-bin
latex-fonts
latexconfig
lm
ltxcmds
luacode
luatexbase
pdftexcmds
pgf
plantuml
scheme-minimal
varwidth
xcolor
xkeyval

0 comments on commit ad5783e

Please sign in to comment.