You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
3.7 KiB

name: CI
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@main
- name: Update rustup
run: rustup self update
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install 1.74.1 -c rust-docs
rustup default 1.74.1
8 months ago
- name: Install mdbook & mdbook-typst-pdf
run: |
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.36/mdbook-v0.4.36-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
8 months ago
curl -sSL https://github.com/KaiserY/mdbook-typst-pdf/releases/download/v0.3.4/mdbook-typst-pdf-x86_64-unknown-linux-musl.tar.xz | tar -xJ --directory=bin --strip-components 1
echo "$(pwd)/bin" >> ${GITHUB_PATH}
- name: Install font
run: |
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
11 months ago
sudo apt-get -y install msttcorefonts
mkdir fonts
mkdir -p ~/.local/share/fonts
7 months ago
curl -sL -o Noto_Sans.zip https://github.com/notofonts/latin-greek-cyrillic/releases/download/NotoSans-v2.013/NotoSans-v2.013.zip
11 months ago
unzip Noto_Sans.zip -d fonts/Noto_Sans
7 months ago
curl -sL -o Noto_Sans_SC.zip https://github.com/notofonts/noto-cjk/releases/download/Sans2.004/08_NotoSansCJKsc.zip
11 months ago
unzip Noto_Sans_SC.zip -d fonts/Noto_Sans_SC
7 months ago
curl -sL -o Noto_Sans_Mono.zip https://github.com/notofonts/latin-greek-cyrillic/releases/download/NotoSansMono-v2.014/NotoSansMono-v2.014.zip
11 months ago
unzip Noto_Sans_Mono.zip -d fonts/Noto_Sans_Mono
7 months ago
curl -sL -o Noto_Sans_KR.zip https://github.com/notofonts/noto-cjk/releases/download/Sans2.004/07_NotoSansCJKkr.zip
11 months ago
unzip Noto_Sans_KR.zip -d fonts/Noto_Sans_KR
7 months ago
curl -sL -o Noto_Sans_Thai.zip https://github.com/notofonts/thai/releases/download/NotoSansThai-v2.002/NotoSansThai-v2.002.zip
11 months ago
unzip Noto_Sans_Thai.zip -d fonts/Noto_Sans_Thai
7 months ago
curl -sL -o Noto_Sans_Arabic.zip https://github.com/notofonts/arabic/releases/download/NotoNaskhArabic-v2.018/NotoNaskhArabic-v2.018.zip
11 months ago
unzip Noto_Sans_Arabic.zip -d fonts/Noto_Sans_Arabic
7 months ago
curl -sL -o Noto_Sans_Hebrew.zip https://github.com/notofonts/hebrew/releases/download/NotoSansHebrew-v2.003/NotoSansHebrew-v2.003.zip
11 months ago
unzip Noto_Sans_Hebrew.zip -d fonts/Noto_Sans_Hebrew
7 months ago
curl -sL -o Noto_Sans_Devanagari.zip https://github.com/notofonts/devanagari/releases/download/NotoSansDevanagari-v2.004/NotoSansDevanagari-v2.004.zip
11 months ago
unzip Noto_Sans_Devanagari.zip -d fonts/Noto_Sans_Devanagari
7 months ago
curl -sL -o NotoColorEmoji.ttf https://github.com/googlefonts/noto-emoji/raw/main/fonts/NotoColorEmoji.ttf
mv NotoColorEmoji.ttf fonts/NotoColorEmoji.ttf
11 months ago
curl -sL -o times_sans_serif.zip https://dl.dafont.com/dl/?f=times_sans_serif
unzip times_sans_serif.zip -d fonts/times_sans_serif
mv fonts/* ~/.local/share/fonts/
fc-cache -rv
- name: Report versions
run: |
rustup --version
rustc -Vv
mdbook --version
- name: Run mdBook Build
3 years ago
run: |
mdbook build
3 years ago
mv book/html/* book/
mv "book/typst-pdf/Rust 程序设计语言 简体中文版.pdf" book/
3 years ago
rm -r book/html/
rm -rf book/typst-pdf/
- name: Deploy gh-pages
if: ${{ github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book
force_orphan: true
3 years ago
enable_jekyll: true