From 809f138f734cff030fab8eb42fd7a61a9bae94de Mon Sep 17 00:00:00 2001 From: Cheng XU Date: Sat, 16 Mar 2024 02:06:59 -0700 Subject: [PATCH] feat: auto set tlmgr repo url for historical texlive version --- action.sh | 5 +++++ entrypoint.sh | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/action.sh b/action.sh index 11c10f9..83f06f7 100755 --- a/action.sh +++ b/action.sh @@ -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" @@ -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" \ diff --git a/entrypoint.sh b/entrypoint.sh index fa9aea6..d0b2bbf 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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"