-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
45 lines (45 loc) · 1.35 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: latex-build-and-release
description: Builds a PDF file from LaTeX source and publishes it as asset in a release.
author: TemplatesHub
branding:
icon: 'file-text'
color: 'green'
inputs:
gh-token:
description: "GitHub token"
type: string
required: false
default: ${{ github.token }}
tex-entry-point:
description: 'Entry point .tex file'
type: string
required: false
default: 'main'
pdf-name:
description: 'Final PDF file name'
type: string
required: false
default: '${{ github.event.repository.name }}'
runs:
using: 'composite'
steps:
- name: "Updating packages"
shell: bash
run: sudo apt-get update
- name: "Install texlive"
shell: bash
run: sudo apt-get -y install texlive-full
- name: "First build PDF file"
shell: bash
run: pdflatex ${{ inputs.tex-entry-point }}.tex
- name: "Second build PDF file for TOC and Images"
shell: bash
run: pdflatex ${{ inputs.tex-entry-point }}.tex
- name: "Rename PDF file"
shell: bash
run: mv ${{ inputs.tex-entry-point }}.pdf "${{ inputs.pdf-name }}-${{ github.ref_name }}.pdf"
- name: "Upload PDF as artifact in release"
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.gh-token }}
run: gh release upload ${{ github.ref_name }} "${{ inputs.pdf-name }}-${{ github.ref_name }}.pdf"