@@ -125,7 +125,9 @@ jobs:
125125
126126 docker container run --rm ${{ steps.variables.outputs.miktex_image }} bash -c 'printf "%s\n" "which pdflatex: $(which pdflatex) ($(pdflatex --version | head -n 1))"'
127127 MIKTEX_VERSION="$(docker container run --rm ${{ steps.variables.outputs.miktex_image }} bash -c "miktex --version | head -n 1")"
128- printf -- "MikTeX version: -%s-\n" "${MIKTEX_VERSION}"
128+
129+ printf -- "MikTeX version (raw): %s\n" "${MIKTEX_VERSION}"
130+ MIKTEX_VERSION="$(echo "${MIKTEX_VERSION}" | grep -oP '\(MiKTeX \d+\.\d+\)' | grep -oP '\d+\.\d+')"
129131
130132 tee "${GITHUB_OUTPUT}" <<EOF
131133 miktex_version=${MIKTEX_VERSION}
@@ -177,51 +179,67 @@ jobs:
177179 ANSI_BLUE=$'\x1b[34m'
178180 ANSI_CYAN=$'\x1b[36m'
179181 ANSI_DARK_GRAY=$'\x1b[90m'
182+ ANSI_LIGHT_BLUE=$'\x1b[94m'
180183 ANSI_NOCOLOR=$'\x1b[0m'
181184
182185 RemoveComments() {
183186 local OutputFile="${2:-$1}"
184187
185- printf "%s \n" "Removing comments from '$1' and writing to '${OutputFile}'."
188+ printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR} \n" "Removing comments from '$1' and writing to '${OutputFile}' .. ."
186189 grep -v '^\s*$\|^\s*\#' "$1" > "${OutputFile}"
187-
188- printf "%s\n" "${ANSI_BLUE}${OutputFile}${ANSI_NOCOLOR}"
189- printf "%s\n" "${ANSI_BLUE}--------------------------------------------------------------------------------${ANSI_NOCOLOR}"
190- while IFS='' read -r line; do
191- printf " %s\n" "${ANSI_CYAN}$line${ANSI_NOCOLOR}"
192- done < "${OutputFile}"
193- printf "%s\n" "${ANSI_BLUE}--------------------------------------------------------------------------------${ANSI_NOCOLOR}"
190+ cat "${OutputFile}" | sed 's/^/ /'
191+ printf "::endgroup::\n"
194192 }
195193
196194 DockerImageSizeUncompressed() {
197195 docker image inspect $1 --format='{{.Size}}' | numfmt --to=iec --format '%.2f'
198196 }
199197
200- printf "%s\n" "Convert '${{ matrix.name }}.list' to 'Packages.list' ..."
198+ printf -- "Convert '${{ matrix.name }}.list' to 'Packages.list' ...\n "
201199 RemoveComments ${{ matrix.name }}.list Packages.list
202200
203- printf "%s\n" "Building docker file 'Dockerfile' ..."
201+ printf -- "Building docker file 'Dockerfile' ...\n "
204202 docker buildx build \
205203 --file Dockerfile.Specific \
206204 --build-arg "IMAGE=${{ needs.MikTeX.outputs.miktex_image }}" \
207- --build-arg "BASE_VARIANT=Debian ${{ needs.MikTeX.outputs.base_image_os_version }} with Python ${{ needs.MikTeX.outputs.base_image_py_version }}" \
208- --build-arg "VARIANT=${{ matrix.name }}" \
205+ --label "org.opencontainers.image.title=MikTeX specific for ${{ matrix.name }} on Debian ${{ steps.variables.outputs.base_image_os_version }} (${{ steps.variables.outputs.base_image_os_codename }}) + Python ${{ steps.variables.outputs.base_image_py_version }}" \
206+ --label "org.opencontainers.image.description=MikTeX specific for ${{ matrix.name }} on Debian ${{ steps.variables.outputs.base_image_os_version }} (${{ steps.variables.outputs.base_image_os_codename }}) + Python ${{ steps.variables.outputs.base_image_py_version }} image maintained by pyTooling Authors." \
207+ --label "org.opencontainers.image.authors=Patrick Lehmann <Paebbels@gmail.com>" \
208+ --label "org.opencontainers.image.vendor=pyTooling" \
209+ --label "org.opencontainers.image.version=1.0" \
210+ --label "org.opencontainers.image.revison=${GITHUB_SHA}" \
211+ --label "org.opencontainers.image.created=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
212+ --label "org.opencontainers.image.url=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}" \
213+ --label "org.opencontainers.image.source=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git" \
214+ --label "org.opencontainers.image.documentation=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/blob/main/README.md" \
215+ --label "org.opencontainers.image.license=MIT" \
216+ --label "pyTooling.dockerimages.application.variant=${{ matrix.name }}" \
209217 --tag "${{ steps.variables.outputs.specific_image }}" \
210218 . 2>&1 \
211219 | ./Docker.buildx.sh
212220
213- printf "%s \n" "Docker image ' ${{ steps.variables.outputs.specific_image }}' has $(DockerImageSizeUncompressed ${{ steps.variables.outputs.specific_image }})"
221+ printf -- "Docker image '%s' has %s \n" "${{ steps.variables.outputs.specific_image }}" " $(DockerImageSizeUncompressed ${{ steps.variables.outputs.specific_image }})"
214222
215223 - name : ☑ Checking MikTeX image '${{ steps.variables.outputs.specific_image }}'
216224 run : |
217- printf "%s\n" "Docker image '${{ steps.variables.outputs.specific_image }}' has $(DockerImageSizeUncompressed ${{ steps.variables.outputs.specific_image }})"
225+ DockerImageSizeUncompressed() {
226+ docker image inspect $1 --format='{{.Size}}' | numfmt --to=iec --format '%.2f'
227+ }
218228
219- docker container run --rm ${{ steps.variables.outputs.specific_image }} 'printf "%s\n" "which pdflatex: $(which pdflatex)"'
229+ printf -- "Docker image '%s' has %s\n" "${{ steps.variables.outputs.specific_image }}" "$(DockerImageSizeUncompressed ${{ steps.variables.outputs.specific_image }})"
230+ printf -- "Labels of '${{ steps.variables.outputs.miktex_image }}':\n"
231+ docker inspect --format='{{json .Config.Labels}}' "${{ steps.variables.outputs.miktex_image }}" | jq
232+
233+ docker container run --rm ${{ steps.variables.outputs.specific_image }} bash -c 'xelatex --version'
220234
221235 - name : 🔑 Login and push '${{ steps.variables.outputs.specific_image }}' to Docker Hub
222236 run : |
223- printf "%s\n" "Login at Docker Hub ..."
237+ DockerImageSizeUncompressed() {
238+ docker image inspect $1 --format='{{.Size}}' | numfmt --to=iec --format '%.2f'
239+ }
240+
241+ printf -- "Login at Docker Hub ...\n"
224242 printf "%s\n" "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u ${{ vars.DOCKERHUB_USERNAME }} --password-stdin
225243
226- printf "%s \n" "Docker image ' ${{ steps.variables.outputs.specific_image }}' has $(DockerImageSizeUncompressed ${{ steps.variables.outputs.specific_image }})"
244+ printf -- "Docker image '%s' has %s \n" "${{ steps.variables.outputs.specific_image }}" " $(DockerImageSizeUncompressed ${{ steps.variables.outputs.specific_image }})"
227245 docker image push ${{ steps.variables.outputs.specific_image }}
0 commit comments