Skip to content

Merge overleaf-2024-04-09-1144 into main #13

Merge overleaf-2024-04-09-1144 into main

Merge overleaf-2024-04-09-1144 into main #13

Workflow file for this run

name: Build LaTeX document & latexdiff to previous tagged version.
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout new version
uses: actions/checkout@v2
with:
path: new
fetch-depth: 0
- name: Set last tag value
run: |
echo ::set-output name=LAST_TAG_NAME::"$(cd new && git describe --tag HEAD^ --abbrev=0)"
id: tag_val_stp
- name: Checkout old version
uses: actions/checkout@v2
with:
path: old
ref: ${{ steps.tag_val_stp.outputs.LAST_TAG_NAME }}
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
with:
root_file: whitepaper.tex
working_directory: new/
- name: Install latexdiff
run: sudo apt-get install latexdiff
- name: Run latexdiff
run: latexdiff -t UNDERLINE --verbose --no-links --flatten old/whitepaper.tex new/whitepaper.tex > new/diff.tex
- name: Compile LaTeX difference document
uses: xu-cheng/latex-action@v2
with:
root_file: diff.tex
working_directory: new/
- name: Check pdf files
run: |
file new/diff.pdf | grep -q ' PDF '
- name: Upload
uses: actions/upload-artifact@v2
with:
name: paper
path: |
new/diff.pdf
new/whitepaper.pdf
steps:
- name: Release
uses: fnkr/github-action-ghr@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GHR_PATH: new/whitepaper.pdf
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}