TLA+ PDF Generation #2
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' | |
- 'Operations.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 Operations.tla | |
run: | | |
java -cp tla2tools.jar tla2tex.TLA -shade -noPcalShade Operations.tla | |
ps2pdf Operations.ps Operations.pdf | |
# Upload PDFs as artifacts in a documents directory | |
- name: Upload PDF Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: TLA+ Specification PDFs | |
path: | | |
p2p.pdf | |
Blockchain.pdf | |
Utils.pdf | |
Operations.pdf |