This commit is contained in:
@@ -17,6 +17,7 @@ jobs:
|
|||||||
|
|
||||||
# Run the whole job inside a Docker container that has Typst installed
|
# Run the whole job inside a Docker container that has Typst installed
|
||||||
steps:
|
steps:
|
||||||
|
- uses: typst-community/setup-typst@v4
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -27,30 +28,20 @@ jobs:
|
|||||||
- name: Debug Ls
|
- name: Debug Ls
|
||||||
run: ls -la "$PWD" && echo "$PWD && echo ${{ github.workspace }}"
|
run: ls -la "$PWD" && echo "$PWD && echo ${{ github.workspace }}"
|
||||||
|
|
||||||
- name: Build Typst builder image
|
- name: Compile Analysis 1
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
with:
|
||||||
tags: typst-builder-image:latest
|
working-directory: ${{ env.TYPST_SOURCE_DIR }}/analysis-1
|
||||||
push: false
|
run: typst compile analysis-1.typ --out-dir "../../${{ env.BUILD_DIR }}"
|
||||||
|
|
||||||
- name: Compile all .typ files
|
- name: Compile Schaltungstheorie
|
||||||
uses: addnab/docker-run-action@v3
|
|
||||||
env:
|
|
||||||
TYPST_SOURCE_DIR: ${{ env.TYPST_SOURCE_DIR }}
|
|
||||||
BUILD_DIR: ${{ env.BUILD_DIR }}
|
|
||||||
with:
|
with:
|
||||||
image: typst-builder-image:latest
|
working-directory: ${{ env.TYPST_SOURCE_DIR }}/schaltungstheorie
|
||||||
options: --volumes-from=${{ env.JOB_CONTAINER_NAME }}
|
run: typst compile schaltungstheorie.typ --out-dir "../../${{ env.BUILD_DIR }}"
|
||||||
cwd: ${{ github.workspace }}
|
|
||||||
run: "cd ${{ github.workspace }} && TYPST_SOURCE_DIR=${{ env.TYPST_SOURCE_DIR }} BUILD_DIR=${{ env.BUILD_DIR }} bash -c ./compile-all.bash"
|
|
||||||
|
|
||||||
- name: Upload PDFs
|
- name: Compile LinAlg
|
||||||
if: always()
|
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
with:
|
||||||
name: typst-pdfs
|
working-directory: ${{ env.TYPST_SOURCE_DIR }}/linAlg
|
||||||
path: ${{ env.BUILD_DIR }}/*.pdf
|
run: typst compile LinearAlgebra.typ --out-dir "../../${{ env.BUILD_DIR }}"
|
||||||
if-no-files-found: warn
|
|
||||||
|
|
||||||
- name: Create Gitea Release
|
- name: Create Gitea Release
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
SRC_DIR="${TYPST_SOURCE_DIR}"
|
|
||||||
OUT_DIR="${BUILD_DIR}"
|
|
||||||
|
|
||||||
if [[ ! -d "$SRC_DIR" ]]; then
|
|
||||||
echo "Source directory '$SRC_DIR' does not exist."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p "$OUT_DIR"
|
|
||||||
|
|
||||||
|
|
||||||
# Find all .typ files under $SRC_DIR (excluding hidden dirs)
|
|
||||||
mapfile -d '' files < <(printf '%s\0' "$SRC_DIR"/*.typ 2>/dev/null)
|
|
||||||
|
|
||||||
if [[ ${#files[@]} -eq 0 ]]; then
|
|
||||||
echo "No .typ files found in '$SRC_DIR'."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
for f in "${files[@]}"; do
|
|
||||||
# Trim leading ./ if present
|
|
||||||
rel="${f#./}"
|
|
||||||
# Destination path: build/<same-subdirs>/<filename>.pdf
|
|
||||||
dest_pdf="${OUT_DIR}/$(basename "${rel%.typ}").pdf"
|
|
||||||
|
|
||||||
echo "Compiling: $f -> $dest_pdf"
|
|
||||||
typst compile "$f" "$dest_pdf"
|
|
||||||
done
|
|
||||||
Reference in New Issue
Block a user