-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (52 loc) · 1.68 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
47
48
49
50
51
52
53
54
55
56
57
58
name: Compile Latex and Release PDF
on:
push:
tags:
- 'v*'
branches:
- '*'
jobs:
build_latex:
runs-on: ubuntu-latest
outputs:
prefix: ${{ steps.repo_name.outputs.prefix }}
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v3
with:
root_file: main.tex
latexmk_shell_escape: true
post_compile: "latexmk -c; rm -rf _minted*"
- name: Get Repository Name
id: repo_name
run: |
ls -lrt
prefix=$(echo "${{ github.repository }}" | cut -d'/' -f2)
echo "prefix=$prefix" >> "$GITHUB_OUTPUT"
echo "pdf=$prefix-${{ github.ref_name }}.pdf" >> "$GITHUB_OUTPUT"
-
name: Rename PDF
run: |
mv main.pdf ${{ steps.repo_name.outputs.pdf }}
- name: Upload PDF
uses: actions/[email protected]
with:
# get the name of the repo without the organisation
name: PDF
path: ${{ steps.repo_name.outputs.pdf }}
-
name: Create Release
id: create_release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
draft: false
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') || contains(github.ref, 'preview') }}
name: Release ${{ github.ref_name }}
generate_release_notes: true
tag_name: ${{ github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
files: |
${{ steps.repo_name.outputs.pdf }}