-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (47 loc) · 1.46 KB
/
compile_pdf_and_upload.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
name: Build LaTeX document and upload
on:
push:
branches:
- main
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2
- name: Check commit message for version tag
id: check_version
run: |
VERSION=$(echo "${{ github.event.head_commit.message }}" | grep -oE "[0-9]+\.[0-9]+\.[0-9]+" || echo "")
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Compile LaTeX document
uses: dante-ev/latex-action@latest
with:
working_directory: Main
root_file: main.tex
- name: Upload PDF file as artifact
uses: actions/upload-artifact@v3
with:
name: PDF
path: Main/main.pdf
- name: Create Release
id: create_release
if: env.VERSION != ''
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
draft: false
prerelease: false
- name: Upload Release Asset
if: env.VERSION != ''
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: Main/main.pdf
asset_name: main.pdf
asset_content_type: application/pdf