Skip to content

Commit 09c0bed

Browse files
Update GitHub Actions workflow for professional preprint
1 parent 9a15e86 commit 09c0bed

1 file changed

Lines changed: 47 additions & 6 deletions

File tree

.github/workflows/build_preprint.yml

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
1-
- name: Extract Metadata and Build LaTeX Title
1+
name: Build Professional Preprint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
env:
8+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
9+
10+
jobs:
11+
build-paper:
12+
runs-on: ubuntu-latest
13+
name: Build Preprint PDF
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v6
17+
18+
- name: Install apt packages
19+
run: |
20+
sudo apt-get update
21+
sudo apt-get install -y pandoc texlive texlive-latex-extra texlive-fonts-recommended texlive-xetex texlive-fonts-extra zip python3-yaml
22+
23+
- name: Extract Metadata and Build LaTeX Title
224
run: |
325
python3 - << 'PYEOF'
426
import yaml
@@ -13,7 +35,7 @@
1335
affiliations = fm.get('affiliations', [])
1436
aff_map = {str(a['index']): a for a in affiliations}
1537
16-
# ── Pandoc Metadata ─────────────────────────────────────────────────
38+
# 1. Generate Pandoc Metadata
1739
meta = {
1840
'title': fm.get('title', ''),
1941
'date': str(fm.get('date', '')),
@@ -26,7 +48,7 @@
2648
with open('/tmp/pandoc_meta.yaml', 'w') as f:
2749
yaml.dump(meta, f)
2850
29-
# ── Title Block Construction ────────────────────────────────────────
51+
# 2. Build LaTeX Title Block
3052
lines = [r'\begin{center}']
3153
lines.append(r'{\LARGE\bfseries ' + fm.get('title','') + r'}\\[1.2em]')
3254
@@ -42,13 +64,15 @@
4264
4365
for idx, aff in aff_map.items():
4466
ror_id = aff.get('ror', '')
67+
# Link ROR IDs for professional institutional verification
4568
ror_link = rf" \small (ROR: \href{{https://ror.org/{ror_id}}}{{{ror_id}}})" if ror_id else ""
4669
lines.append(rf'$^{{{idx}}}$\small {aff["name"]}{ror_link}\\[0.2em]')
4770
4871
corres = [a['email'] for a in authors if a.get('corresponding') and a.get('email')]
4972
if corres:
5073
lines.append(rf'\small $^*$Corresponding author: \href{{mailto:{corres[0]}}}{{{corres[0]}}}\\[0.2em]')
5174
75+
# Explicit Zenodo DOI for the PICA suite
5276
lines.append(r'\small DOI: \href{https://doi.org/10.5281/zenodo.18377216}{10.5281/zenodo.18377216}\\[0.2em]')
5377
lines.append(r'\small ' + str(fm.get('date','')))
5478
lines.append(r'\end{center}')
@@ -58,7 +82,7 @@
5882
f.write('\n'.join(lines))
5983
PYEOF
6084
61-
- name: Create Header
85+
- name: Create Professional Header
6286
run: |
6387
cat > /tmp/header.tex << 'EOF'
6488
\usepackage{xurl}
@@ -71,17 +95,34 @@
7195
\pagestyle{fancy}
7296
\fancyhf{}
7397
74-
% ── Clear Preprint Identification ───────────────────────────────────
98+
% Clear identification as a preprint while maintaining professional style
7599
\fancyhead[L]{\small \textbf{\textcolor{gray}{PREPRINT -- NOT PEER REVIEWED}}}
76100
\fancyhead[R]{\small \textit{PICA: Advanced Transport Automation}}
77101
\fancyfoot[C]{\thepage}
78102
\renewcommand{\headrulewidth}{0.4pt}
79103
80-
% ── Internal Reference Logic ────────────────────────────────────────
81104
\renewcommand{\maketitle}{}
82105
\hypersetup{
83106
breaklinks=true,
84107
pdfauthor={Deshmukh and Mukherjee},
85108
pdftitle={PICA: High-Precision Automation}
86109
}
87110
EOF
111+
112+
- name: Generate Publication-Ready PDF
113+
run: |
114+
cd paper
115+
pandoc paper.md -o paper.pdf \
116+
--standalone \
117+
--citeproc \
118+
--pdf-engine=xelatex \
119+
--metadata-file=/tmp/pandoc_meta.yaml \
120+
--include-in-header=/tmp/header.tex \
121+
--include-before-body=/tmp/title_block.tex \
122+
--variable=link-citations=true
123+
124+
- name: Upload Artifact
125+
uses: actions/upload-artifact@v4
126+
with:
127+
name: professional-preprint
128+
path: paper/paper.pdf

0 commit comments

Comments
 (0)