Skip to content

Commit 15fa85c

Browse files
committed
feat: Add texlive and run filtering for workflows
1 parent 7124e4e commit 15fa85c

4 files changed

Lines changed: 96 additions & 0 deletions

File tree

.github/workflows/build-python.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Build Python image
22

33
on:
44
push:
5+
paths:
6+
- src/python
7+
- .github/workflows/build-python.yml
8+
- .github/workflows/reusable-build.yml
9+
workflow_dispatch:
510

611
jobs:
712
build:
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build TeXLive image
2+
3+
on:
4+
push:
5+
paths:
6+
- src/texlive
7+
- .github/workflows/build-texlive.yml
8+
- .github/workflows/reusable-build.yml
9+
workflow_dispatch:
10+
11+
jobs:
12+
build:
13+
uses: ./.github/workflows/reusable-build.yml
14+
permissions:
15+
contents: read
16+
packages: write
17+
secrets: inherit
18+
strategy:
19+
matrix:
20+
version:
21+
- 2023
22+
- 2024
23+
with:
24+
image: texlive
25+
tag: ${{ matrix.version }}

src/texlive/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM mcr.microsoft.com/devcontainers/base:1-ubuntu-24.04
2+
3+
ARG TEXLIVE_VERSION
4+
5+
COPY install_texlive.sh /tmp/
6+
7+
RUN \
8+
TEXLIVE_VERSION=${TEXLIVE_VERSION} bash /tmp/install_texlive.sh && \
9+
rm /tmp/install_texlive.sh && \
10+
sed -i "s~export PATH=~export PATH=/usr/local/texlive/${TEXLIVE_VERSION}/bin/x86_64-linux:~" /etc/profile.d/00-restore-env.sh

src/texlive/install_texlive.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
set -e
3+
4+
TEXLIVE_VERSION="${1:-${TEXLIVE_VERSION}}"
5+
TEXLIVE_LATEST_VERSION="2025"
6+
7+
if [ -z "${TEXLIVE_VERSION}" ]
8+
then
9+
echo "texlive version not specified!"
10+
exit 1
11+
fi
12+
13+
apt-get update
14+
apt-get install -y perl curl
15+
16+
echo "Downloading TeXLive ${TEXLIVE_VERSION} installer..."
17+
18+
cd /tmp
19+
20+
curl -L -o install-tl-unx.tar.gz https://texlive.info/historic/systems/texlive/${TEXLIVE_VERSION}/install-tl-unx.tar.gz
21+
mkdir tl
22+
tar -xzf install-tl-unx.tar.gz -C tl --strip-components=1
23+
24+
cd /tmp/tl
25+
26+
_OPTS=""
27+
28+
if [ $TEXLIVE_VERSION -lt $TEXLIVE_LATEST_VERSION ]
29+
then
30+
TEXLIVE_REPO_URL="ftp://tug.org/historic/systems/texlive/${TEXLIVE_VERSION}/tlnet-final"
31+
_OPTS="$_OPTS --repository $TEXLIVE_REPO_URL"
32+
fi
33+
34+
case "$TEXLIVE_VERSION" in
35+
2025 | 2024 | 2023)
36+
_OPTS="$_OPTS -no-doc-install -no-src-install"
37+
;;
38+
*)
39+
_OPTS="$_OPTS"
40+
;;
41+
esac
42+
43+
perl ./install-tl -no-interaction ${_OPTS}
44+
45+
cd /tmp
46+
47+
rm -rf texlive.profile tl
48+
49+
echo "Installing LaTeX Workshop dependencies..."
50+
51+
apt-get install -y libyaml-tiny-perl libfile-homedir-perl
52+
53+
echo "Cleanup..."
54+
55+
apt clean
56+
rm -rf /var/lib/apt/lists/*

0 commit comments

Comments
 (0)