Skip to content

Commit

Permalink
feat: auto set tlmgr repo url for historical texlive version
Browse files Browse the repository at this point in the history
  • Loading branch information
xu-cheng committed Mar 16, 2024
1 parent c41b2ac commit 809f138
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ if [[ -n "$INPUT_TEXLIVE_VERSION" && -n "$INPUT_DOCKER_IMAGE" ]]; then
error "Input 'texlive_version' and 'docker_image' cannot co-exist".
fi

export INPUT_TLMGR_REPO=""

if [[ -z "$INPUT_DOCKER_IMAGE" ]]; then
INPUT_TLMGR_REPO="$INPUT_TEXLIVE_VERSION"
case "$INPUT_TEXLIVE_VERSION" in
"" | "latest" | "2024")
image_version="latest"
INPUT_TLMGR_REPO="latest"
;;
"2023")
image_version="20240301"
Expand Down Expand Up @@ -69,6 +73,7 @@ run docker run --rm \
-e "INPUT_LATEXMK_SHELL_ESCAPE" \
-e "INPUT_LATEXMK_USE_LUALATEX" \
-e "INPUT_LATEXMK_USE_XELATEX" \
-e "INPUT_TLMGR_REPO" \
-e "GITHUB_JOB" \
-e "GITHUB_REF" \
-e "GITHUB_SHA" \
Expand Down
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ if [[ -n "$INPUT_EXTRA_FONTS" ]]; then
fc-cache -fv
fi

if [[ -n "$INPUT_TLMGR_REPO" && "$INPUT_TLMGR_REPO" != latest ]]; then
tlmgr_repo_url="https://ftp.math.utah.edu/pub/tex/historic/systems/texlive/$INPUT_TLMGR_REPO/tlnet-final"
info "Set tlmgr repo to $tlmgr_repo_url"
tlmgr option repository "$tlmgr_repo_url"
fi

if [[ -n "$INPUT_PRE_COMPILE" ]]; then
info "Run pre compile commands"
eval "$INPUT_PRE_COMPILE"
Expand Down

0 comments on commit 809f138

Please sign in to comment.