-
-
Notifications
You must be signed in to change notification settings - Fork 359
/
Copy pathbuild-docs.sh
101 lines (89 loc) · 2.79 KB
/
build-docs.sh
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
101
#!/usr/bin/env bash
set -e
key_unset=false
if [ -z "$DOCUMENTER_KEY" ]; then
echo '`DOCUMENTER_KEY` is missing'
key_unset=true
fi
tok_unset=false
if [ -z "$GITHUB_TOKEN" ]; then
echo '`GITHUB_TOKEN` is missing'
tok_unset=true
fi
if $key_unset && $tok_unset; then
echo 'either `GITHUB_TOKEN` or `DOCUMENTER_KEY` must be set for `Documenter` !'
exit 1
fi
echo '== install system dependencies =='
sudo apt -y update
sudo apt -y install \
texlive-{latex-{base,extra},binaries,pictures,luatex} \
ttf-mscorefonts-installer \
poppler-utils \
ghostscript-x \
qtbase5-dev \
pdf2svg \
gnuplot \
g++
echo '== install fonts =='
mkdir -p ~/.fonts
repo="https://github.com/cormullion/juliamono"
ver="$(git -c 'versionsort.suffix=-' ls-remote --tags --sort='v:refname' "$repo.git" | tail -n 1 | awk '{ print $2 }' | sed 's,refs/tags/,,')"
url="$repo/releases/download/$ver/JuliaMono-ttf.tar.gz"
echo "downloading & extract url=$url"
wget -q "$url" -O - | tar -xz -C ~/.fonts
sudo fc-cache -vr
fc-list | grep 'JuliaMono'
echo "== install julia dependencies =="
if true; then
export JULIA_DEBUG='Documenter,Literate,DemoCards'
export DOCUMENTER_DEBUG=true # Democards.jl
fi
export LD_PRELOAD=$(g++ --print-file-name=libstdc++.so)
export GKSwstype=nul # Plots.jl/issues/3664
export MPLBACKEND=agg
export COLORTERM=truecolor # UnicodePlots.jl
export PLOTDOCS_ANSICOLOR=true
export JULIA_CONDAPKG_BACKEND=MicroMamba
julia='xvfb-run -a julia --color=yes --project=docs'
JULIA_PKG_PRECOMPILE_AUTO=0 $julia -e '
using Pkg; Pkg.add("CondaPkg")
using CondaPkg; CondaPkg.resolve()
libgcc = if Sys.islinux()
# see discourse.julialang.org/t/glibcxx-version-not-found/82209/8
# julia 1.8.3 is built with libstdc++.so.6.0.29, so we must restrict to this version (gcc 11.3.0, not gcc 12.2.0)
# see gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
specs = Dict(
v"3.4.29" => ">=11.1,<12.1",
v"3.4.30" => ">=12.1,<13.1",
v"3.4.31" => ">=13.1,<14.1",
v"3.4.32" => ">=14.1,<15.1",
v"3.4.33" => ">=15.1,<16.1",
v"3.4.34" => ">=16.1,<17.1",
# ... keep this up-to-date with gcc 18
)[Base.BinaryPlatforms.detect_libstdcxx_version()]
("libgcc-ng$specs", "libstdcxx-ng$specs")
else
()
end
CondaPkg.PkgREPL.add([libgcc..., "matplotlib"])
CondaPkg.status()
'
echo "== build documentation for $GITHUB_REPOSITORY@$GITHUB_REF, triggered by $GITHUB_ACTOR on $GITHUB_EVENT_NAME =="
JULIA_PKG_PRECOMPILE_AUTO=0 $julia -e '
using Pkg
rev = split(ENV["GITHUB_REF"], "/", limit=3)[3]
println("rev=$rev")
Pkg.develop([
(; path="./RecipesBase"),
(; path="./RecipesPipeline"),
(; path="./PlotsBase"),
(; path="."),
(; path="./GraphRecipes"),
(; path="./StatsPlots"),
])
Pkg.add(PackageSpec(; name="Plots", rev))
Pkg.instantiate()
Pkg.precompile()
'
$julia docs/make.jl