-
Notifications
You must be signed in to change notification settings - Fork 15
100 lines (82 loc) · 3.02 KB
/
build.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Build LaTeX document
on: [push]
env:
COMMAND: latexmk -pdf -interaction=nonstopmode -halt-on-error Thesis.tex
jobs:
build_unix:
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Download GitHub repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install TeX Live using apt
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt update && sudo apt install -y texlive-full
- name: Compile LaTeX document on Linux
if: startsWith(matrix.os, 'ubuntu')
run: eval "$COMMAND"
- name: Install MacTeX using Homebrew
if: startsWith(matrix.os, 'macos')
run: brew install --cask mactex
- name: Compile LaTeX document on macOS
if: startsWith(matrix.os, 'macos')
run: |
eval "$(/usr/libexec/path_helper)"
eval "$COMMAND"
build_windows:
runs-on: windows-latest
env:
MIKTEX_BASE_URL: 'https://ctan.math.illinois.edu/systems/win32/miktex'
MIKTEX_ZIP: 'miktexsetup-5.5.0+1763023-x64.zip'
LOCAL_MIKTEX_REPO: 'C:/MiKTeX-Repo'
BIN_DIR_WINDOWS: 'C:/Program Files/MiKTeX/miktex/bin/x64/'
BIN_DIR_WINDOWS_UNIX: '/c/Program Files/MiKTeX/miktex/bin/x64/'
steps:
- name: Download GitHub repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download MiKTeX CLI installer
shell: bash
run: |
curl --location --remote-name $MIKTEX_BASE_URL/setup/windows-x64/$MIKTEX_ZIP
unzip $MIKTEX_ZIP
- name: Set up the local package directory
shell: bash
run: |
./miktexsetup_standalone --verbose \
--local-package-repository=$LOCAL_MIKTEX_REPO \
--remote-package-repository="$MIKTEX_BASE_URL/tm/packages/" \
--package-set=essential \
download
- name: Installing from the local package directory
shell: bash
run: |
./miktexsetup_standalone --verbose \
--local-package-repository=$LOCAL_MIKTEX_REPO \
--package-set=essential \
--shared=yes \
install
- name: Update packages
shell: bash
run: |
# Adding MiKTeX bin folder to PATH and to GITHUB_PATH
echo "$BIN_DIR_WINDOWS" >> $GITHUB_PATH
export PATH="$BIN_DIR_WINDOWS_UNIX:$PATH"
# Configure MiKTeX to install missing packages on the fly"
initexmf --admin --verbose --set-config-value='[MPM]AutoInstall=1'
# Configure default mirror for packages
mpm --admin --set-repository="$MIKTEX_BASE_URL/tm/packages/"
mpm --find-updates
mpm --admin --find-updates
- name: Compile LaTeX document
shell: bash
run: |
# Adding MiKTeX bin folder to PATH and to GITHUB_PATH
echo "$BIN_DIR_WINDOWS" >> $GITHUB_PATH
export PATH="$BIN_DIR_WINDOWS_UNIX:$PATH"
eval "$COMMAND"