forked from jackolney/travis-ci-latex-pdf
-
-
Notifications
You must be signed in to change notification settings - Fork 23
73 lines (71 loc) · 2.46 KB
/
texlive.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: texlive
on: push
env:
FILE: pythontex-example
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v1
- name: Cache installation
id: cache-texlive
uses: actions/cache@v2
with:
path: |
/tmp/texlive
$HOME/.texlive
key: ${{ runner.os }}-texlive-2021
# Only required for pythontex
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.x
architecture: x64
- name: Install and compile
run: |
pip install numpy pygments
cd 4-texlive/
source ./texlive/texlive_install.sh
cd ../src
texliveonfly $FILE.tex
pythontex $FILE
pdflatex $FILE.tex
- name: Set filename
id: output_file
run: |
echo ::set-output name=OUTPUT_FILE::src/$FILE.pdf
- name: Upload pdf
uses: actions/upload-artifact@v2
with:
name: github-actions-pdf
path: ${{ steps.output_file.outputs.OUTPUT_FILE }}
# The following steps are just for creating a GitHub release when a git tag is pushed
- name: Create Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Prepare output path and output name
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
id: prepare_metadata
# upload-release-asset does not support wildcards or environment variables at the moment
run: |
echo ::set-output name=ARTIFACT_PATH::src/$FILE.pdf
echo ::set-output name=ARTIFACT_NAME::$FILE.pdf
- name: Upload Release Asset
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.prepare_metadata.outputs.ARTIFACT_PATH }}
asset_name: ${{ steps.prepare_metadata.outputs.ARTIFACT_NAME }}
asset_content_type: application/pdf