This commit is contained in:
@@ -17,6 +17,7 @@ jobs:
|
||||
|
||||
# Run the whole job inside a Docker container that has Typst installed
|
||||
steps:
|
||||
- uses: typst-community/setup-typst@v4
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -27,30 +28,20 @@ jobs:
|
||||
- name: Debug Ls
|
||||
run: ls -la "$PWD" && echo "$PWD && echo ${{ github.workspace }}"
|
||||
|
||||
- name: Build Typst builder image
|
||||
uses: docker/build-push-action@v2
|
||||
- name: Compile Analysis 1
|
||||
with:
|
||||
tags: typst-builder-image:latest
|
||||
push: false
|
||||
working-directory: ${{ env.TYPST_SOURCE_DIR }}/analysis-1
|
||||
run: typst compile analysis-1.typ --out-dir "../../${{ env.BUILD_DIR }}"
|
||||
|
||||
- name: Compile all .typ files
|
||||
uses: addnab/docker-run-action@v3
|
||||
env:
|
||||
TYPST_SOURCE_DIR: ${{ env.TYPST_SOURCE_DIR }}
|
||||
BUILD_DIR: ${{ env.BUILD_DIR }}
|
||||
- name: Compile Schaltungstheorie
|
||||
with:
|
||||
image: typst-builder-image:latest
|
||||
options: --volumes-from=${{ env.JOB_CONTAINER_NAME }}
|
||||
cwd: ${{ github.workspace }}
|
||||
run: "cd ${{ github.workspace }} && TYPST_SOURCE_DIR=${{ env.TYPST_SOURCE_DIR }} BUILD_DIR=${{ env.BUILD_DIR }} bash -c ./compile-all.bash"
|
||||
working-directory: ${{ env.TYPST_SOURCE_DIR }}/schaltungstheorie
|
||||
run: typst compile schaltungstheorie.typ --out-dir "../../${{ env.BUILD_DIR }}"
|
||||
|
||||
- name: Upload PDFs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
- name: Compile LinAlg
|
||||
with:
|
||||
name: typst-pdfs
|
||||
path: ${{ env.BUILD_DIR }}/*.pdf
|
||||
if-no-files-found: warn
|
||||
working-directory: ${{ env.TYPST_SOURCE_DIR }}/linAlg
|
||||
run: typst compile LinearAlgebra.typ --out-dir "../../${{ env.BUILD_DIR }}"
|
||||
|
||||
- name: Create Gitea Release
|
||||
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