-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (46 loc) · 1.36 KB
/
latex.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
46
name: Build LaTeX document
on: [push]
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v2
with:
root_file: main.tex
latexmk_use_xelatex: true
- name: Set Output
id: vars
# https://stackoverflow.com/a/61560798
# https://stackoverflow.com/a/58178121
run: |
echo ::set-output name=repo::${GITHUB_REPOSITORY#*/}
echo ::set-output name=tag::${GITHUB_REF#refs/*/}
- name: Rename for release
env:
RELEASE: ${{ steps.vars.outputs.tag}}
REPO: ${{ steps.vars.outputs.repo}}
run: |
echo $REPO
echo $RELEASE
cp main.pdf $REPO-$RELEASE.pdf
ls *.pdf
- uses: actions/upload-artifact@v2
env:
RELEASE: ${{ steps.vars.outputs.tag}}
REPO: ${{ steps.vars.outputs.repo}}
with:
name: PDF
path: |
$REPO-$RELEASE.pdf
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
env:
RELEASE: ${{ steps.vars.outputs.TAG}}
REPO: ${{ steps.vars.outputs.REPONAME}}
with:
files: |
$REPO-$RELEASE.pdf