-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (71 loc) · 2.65 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
name: Build
on:
workflow_dispatch:
pull_request:
push:
branches:
- master
env:
python_version: "3.12"
# pandoc_version: "3.2"
DEBIAN_FRONTEND: "noninteractive"
jobs:
build:
runs-on: ubuntu-latest
container: pandoc/extra:latest-ubuntu
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.python_version }}
- name: Install Pandoc Filters
uses: BSFishy/pip-action@v1
with:
packages: |
setuptools
wheel
pandocfilters
Pygments
# - name: Install Pandoc
# run: |
# mkdir -p /tmp/pandoc
# cd /tmp/pandoc
# python -m pip --no-cache-dir install setuptools wheel
# python -m pip --no-cache-dir install pandocfilters Pygments
# sudo apt install -y texlive texlive-xetex texlive-lang-chinese latexmk wget
# wget -q "https://github.com/jgm/pandoc/releases/download/${{ env.pandoc_version }}/pandoc-${{ env.pandoc_version }}-1-amd64.deb"
# sudo dpkg -i pandoc-${{ env.pandoc_version }}-1-amd64.deb
# rm -rf *.deb
- name: Install Fonts
run: |
mkdir -p /tmp/adodefont
cd /tmp/adodefont
apt update -y
apt install -y texlive texlive-xetex texlive-lang-chinese latexmk wget unzip
tlmgr install minted
wget -q -O source-code-pro.zip https://github.com/adobe-fonts/source-code-pro/archive/2.030R-ro/1.050R-it.zip
wget -q -O source-han-serif.zip https://github.com/adobe-fonts/source-han-serif/archive/1.001R.zip
wget -q -O source-han-sans.zip https://github.com/adobe-fonts/source-han-sans/archive/2.001R.zip
unzip -q source-code-pro.zip -d source-code-pro
unzip -q source-han-serif.zip -d source-han-serif
unzip -q source-han-sans.zip -d source-han-sans
mkdir -p ~/.fonts
cp -v source-code-pro/*/OTF/*.otf ~/.fonts/
cp -v source-han-serif/*/SubsetOTF/*/*.otf ~/.fonts/
cp -v source-han-sans/*/SubsetOTF/*/*.otf ~/.fonts/
fc-cache -f
# rm -rf source-code-pro{,.zip} source-han-serif{,.zip} source-han-sans{,.zip}
- name: Generate PDF
run: |
mkdir -p ~/.pandoc/templates
cp pandoc/algo.latex ~/.pandoc/templates/
bash pandoc/gen.sh
mkdir build
cp template.pdf build/template.pdf
- name: Release
uses: ncipollo/release-action@v1.14.0
with:
artifacts: "build/template.pdf"
tag: ${{ github.run_id }}