TLA+ PDF Generation #4
This file contains 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: TLA+ PDF Generation | |
on: | |
push: | |
paths: | |
- 'p2p.tla' | |
- 'Blockchain.tla' | |
- 'Utils.tla' | |
- 'Operators.tla' | |
workflow_dispatch: | |
jobs: | |
generate_pdfs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
# Install Java | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
# Install LaTeX and Ghostscript for PDF generation | |
- name: Install LaTeX and Ghostscript | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y texlive-latex-base texlive-latex-extra texlive-fonts-recommended ghostscript | |
# Download TLA+ Tools for PDF generation | |
- name: Download TLA+ Tools | |
run: | | |
wget https://github.com/tlaplus/tlaplus/releases/latest/download/tla2tools.jar | |
# Generate PDFs for each TLA+ file | |
- name: Generate PDF for p2p.tla | |
run: | | |
java -cp tla2tools.jar tla2tex.TLA -shade -noPcalShade p2p.tla | |
ps2pdf p2p.ps p2p.pdf | |
- name: Generate PDF for Blockchain.tla | |
run: | | |
java -cp tla2tools.jar tla2tex.TLA -shade -noPcalShade Blockchain.tla | |
ps2pdf Blockchain.ps Blockchain.pdf | |
- name: Generate PDF for Utils.tla | |
run: | | |
java -cp tla2tools.jar tla2tex.TLA -shade -noPcalShade Utils.tla | |
ps2pdf Utils.ps Utils.pdf | |
- name: Generate PDF for Operators.tla | |
run: | | |
java -cp tla2tools.jar tla2tex.TLA -shade -noPcalShade Operators.tla | |
ps2pdf Operators.ps Operators.pdf | |
# Upload p2p PDF | |
- name: Upload p2p Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: p2p PDF | |
path: | |
p2p.pdf | |
# Upload Blockchain PDF | |
- name: Blockchain PDF | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Blockchain PDF | |
path: | |
Blockchain.pdf | |
# Upload Utils PDF | |
- name: Utils PDF | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Utils PDF | |
path: | |
Utils.pdf | |
# Upload Operators PDF | |
- name: Operators PDF | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Operators PDF | |
path: | |
Operators.pdf |