Skip to content

Commit

Permalink
Minimal macOS support
Browse files Browse the repository at this point in the history
  • Loading branch information
zauguin committed Feb 25, 2024
1 parent 5c4838a commit 524ed5a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ runs:
uses: actions/cache/restore@v4
with:
path: ~/texlive
key: texlive-${{ inputs.cache_version }}-${{ hashFiles(inputs.package_file) }}-${{ steps.key-parts.outputs.packages-hash }}-${{ steps.key-parts.outputs.date }}
restore-keys: texlive-${{ inputs.cache_version }}-${{ hashFiles(inputs.package_file) }}-${{ steps.key-parts.outputs.packages-hash }}-
key: texlive-${{ runner.os }}-${{ inputs.cache_version }}-${{ hashFiles(inputs.package_file) }}-${{ steps.key-parts.outputs.packages-hash }}-${{ steps.key-parts.outputs.date }}
restore-keys: texlive-${{ runner.os }}-${{ inputs.cache_version }}-${{ hashFiles(inputs.package_file) }}-${{ steps.key-parts.outputs.packages-hash }}-
- run: '"${{ github.action_path }}/texlive.sh"'
if: steps.load-cache.outputs.cache-hit != 'true'
id: install
Expand All @@ -64,6 +64,10 @@ runs:
if: runner.os == 'Linux'
shell: sh
run: echo "$HOME/texlive/bin/x86_64-linux" >> $GITHUB_PATH
- name: Set path
if: runner.os == 'macOS'
shell: sh
run: echo "$HOME/texlive/bin/universal-darwin" >> $GITHUB_PATH
- name: Set path
if: runner.os == 'Windows'
shell: sh
Expand Down
12 changes: 11 additions & 1 deletion texlive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,35 @@
# required

# See if there is a cached version of TL available
TEXLIVE_REPOSITORY="${TEXLIVE_REPOSITORY:-$(curl -s https://zauguin.github.io/texlive-mirrors/us | shuf -n 1)}"
case "$(uname -o)" in
Msys)
HOMEDIR="$(cygpath -m ~)"
PLATFORM_NAME="windows"
INSTALLER="./install-tl-windows.bat"
TLMGR="tlmgr.bat"
SHUF="shuf"
;;
"GNU/Linux")
HOMEDIR="$HOME"
PLATFORM_NAME="x86_64-linux"
INSTALLER="./install-tl"
TLMGR="tlmgr"
SHUF="shuf"
;;
Darwin)
HOMEDIR="$HOME"
PLATFORM_NAME="universal-darwin"
INSTALLER="./install-tl"
TLMGR="tlmgr"
SHUF="gshuf"
brew install coreutils
;;
*)
echo "Unknown OS: $(uname -o)" >&2
exit 1
;;
esac
TEXLIVE_REPOSITORY="${TEXLIVE_REPOSITORY:-$(curl -s https://zauguin.github.io/texlive-mirrors/us | "$SHUF" -n 1)}"
export PATH="$HOME/texlive/bin/$PLATFORM_NAME:$PATH"
if ! command -v texlua > /dev/null; then
# Obtain TeX Live
Expand Down

0 comments on commit 524ed5a

Please sign in to comment.