mirror of
https://github.com/hanzoai/papers.git
synced 2026-10-22 17:20:17 +00:00
feat(ci): compile defense papers, add GitHub release step
This commit is contained in:
@@ -35,25 +35,60 @@ jobs:
|
||||
sudo apt-get install -y texlive-full
|
||||
|
||||
- name: Compile all papers
|
||||
run: make all
|
||||
run: |
|
||||
make all
|
||||
|
||||
# Defense papers (separate style)
|
||||
mkdir -p pdfs/defense
|
||||
cd defense
|
||||
for texfile in *.tex; do
|
||||
[ "$texfile" = "hanzo-defense.sty" ] && continue
|
||||
[ "$texfile" = "logo-convert.tex" ] && continue
|
||||
basename="${texfile%.tex}"
|
||||
echo "Compiling defense/$texfile..."
|
||||
pdflatex -interaction=nonstopmode "$texfile" || true
|
||||
bibtex "$basename" 2>/dev/null || true
|
||||
pdflatex -interaction=nonstopmode "$texfile" || true
|
||||
pdflatex -interaction=nonstopmode "$texfile" || true
|
||||
[ -f "${basename}.pdf" ] && cp "${basename}.pdf" ../pdfs/defense/ && echo " OK defense/${basename}.pdf" || echo " FAIL defense/${basename}.pdf"
|
||||
rm -f *.aux *.log *.bbl *.blg *.out *.toc
|
||||
done
|
||||
cd ..
|
||||
|
||||
- name: List generated PDFs
|
||||
run: ls -lh pdfs/*.pdf 2>/dev/null || echo "No PDFs generated"
|
||||
run: find pdfs -name '*.pdf' | sort
|
||||
|
||||
- name: Upload PDFs as artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: hanzo-papers
|
||||
path: pdfs/*.pdf
|
||||
path: |
|
||||
pdfs/*.pdf
|
||||
pdfs/zen/*.pdf
|
||||
pdfs/defense/*.pdf
|
||||
retention-days: 90
|
||||
|
||||
- name: Create release with PDFs
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: v${{ github.run_number }}
|
||||
name: "Hanzo Papers Build #${{ github.run_number }}"
|
||||
files: |
|
||||
pdfs/*.pdf
|
||||
pdfs/zen/*.pdf
|
||||
pdfs/defense/*.pdf
|
||||
make_latest: true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Commit PDFs back to repository
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
run: |
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
|
||||
git add pdfs/*.pdf 2>/dev/null || true
|
||||
git add pdfs/*.pdf pdfs/zen/*.pdf pdfs/defense/*.pdf 2>/dev/null || true
|
||||
|
||||
if git diff --staged --quiet; then
|
||||
echo "No changes to commit"
|
||||
|
||||
Reference in New Issue
Block a user