Skip to content

Commit 89f3bed

Browse files
committed
feat(build-manual.yml): add manual build ci
1 parent 321295e commit 89f3bed

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

.github/workflows/build-manual.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Build Typst manual and upload artifact
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: write
14+
15+
env:
16+
FONT_DIR: ".fonts"
17+
FONT_VERSION: "v1"
18+
19+
jobs:
20+
build-and-upload:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v5
24+
with:
25+
fetch-depth: 0
26+
27+
- uses: actions/cache@v4
28+
with:
29+
path: ${{ env.FONT_DIR }}
30+
key: fonts-${{ runner.os }}-${{ env.FONT_VERSION }}
31+
32+
- name: Install dependencies
33+
run: |
34+
sudo apt-get update -y
35+
sudo apt-get install -y curl unzip
36+
37+
- name: Create font dir
38+
run: |
39+
mkdir -p "${{ env.FONT_DIR }}"
40+
41+
- name: Download Noto Serif CJK SC
42+
run: |
43+
curl -fL "https://github.com/notofonts/noto-cjk/releases/download/Serif2.003/09_NotoSerifCJKsc.zip" -o "${{ env.FONT_DIR }}/noto-serif-sc.zip"
44+
45+
- name: Download Noto Sans CJK SC
46+
run: |
47+
curl -fL "https://github.com/notofonts/noto-cjk/releases/download/Sans2.004/08_NotoSansCJKsc.zip" -o "${{ env.FONT_DIR }}/noto-sans-sc.zip"
48+
49+
- name: Download LXGW WenKai
50+
run: |
51+
curl -fL "https://github.com/lxgw/LxgwWenKai/releases/download/v1.521/lxgw-wenkai-v1.521.zip" -o "${{ env.FONT_DIR }}/lxgw-wenkai.zip"
52+
53+
- name: Download Courier Prime Code
54+
run: |
55+
curl -fL "https://quoteunquoteapps.com/courierprime/downloads/courier-prime-code.zip" -o "${{ env.FONT_DIR }}/courier-prime-code.zip"
56+
57+
- name: Install font
58+
run: |
59+
# Unzip everything
60+
for z in "${{ env.FONT_DIR }}"/*.zip; do
61+
[ -f "$z" ] || continue
62+
echo "Unzipping $z"
63+
unzip -o "$z" -d "${{ env.FONT_DIR }}" || true
64+
done
65+
sudo mkdir -p /usr/local/share/fonts/typst/
66+
sudo cp -r "${{ env.FONT_DIR }}" /usr/local/share/fonts/typst
67+
sudo fc-cache -f -v
68+
69+
- uses: actions/cache@v4
70+
with:
71+
path: ${{ env.FONT_DIR }}
72+
key: fonts-${{ runner.os }}-${{ env.FONT_VERSION }}
73+
74+
- uses: actions-rs/toolchain@v1
75+
with:
76+
toolchain: stable
77+
override: true
78+
79+
- name: Install typst
80+
run: |
81+
cargo install --locked typst-cli || true
82+
echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
83+
84+
- name: Build manual.typ -> llmanual.pdf (with --features html)
85+
run: |
86+
typst compile "manual/src/content/manual.typ" "manual/llmanual.pdf" --features html
87+
88+
- name: Upload PDF as artifact
89+
uses: actions/upload-artifact@v3
90+
with:
91+
name: llmanual.pdf
92+
path: manual/llmanual.pdf

0 commit comments

Comments
 (0)