Build #63
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | |
pwd | |
ls | |
mkdir -p ~/.pandoc/templates | |
cp pandoc/algo.latex ~/.pandoc/templates/algo.latex | |
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 }} | |