Added a build script
All checks were successful
Build Typst PDFs (Docker) / build-typst (push) Successful in 6s
All checks were successful
Build Typst PDFs (Docker) / build-typst (push) Successful in 6s
CI Fix: Node not found Ci Fix
This commit is contained in:
31
.gitea/workflows/build-script.yaml
Normal file
31
.gitea/workflows/build-script.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
# .gitea/workflows/typst-build.yml
|
||||
name: Build Typst PDFs (Docker)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
# Change this to the folder that contains your .typ files (relative to repo root)
|
||||
env:
|
||||
TYPST_SOURCE_DIR: src
|
||||
BUILD_DIR: build
|
||||
|
||||
jobs:
|
||||
build-typst:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Run the whole job inside a Docker container that has Typst installed
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: false
|
||||
lfs: false
|
||||
|
||||
- name: Show Typst & OS versions
|
||||
run: |
|
||||
typst --version || true
|
||||
uname -a
|
||||
2
.vscode/tasks.json
vendored
2
.vscode/tasks.json
vendored
@@ -3,7 +3,7 @@
|
||||
{
|
||||
"label": "Compile All",
|
||||
"type": "shell",
|
||||
"command": "./compile-all.bash",
|
||||
"command": "TYPST_SOURCE_DIR=src BUILD_DIR=output ./compile-all.bash",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
|
||||
@@ -1,11 +1,30 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Find all .typ files under src/ (recursive) into an array
|
||||
mapfile -d '' LIST_OF_TYPST_FILES < <(find src -maxdepth 1 -type f -name '*.typ' -print0)
|
||||
set -euo pipefail
|
||||
SRC_DIR="${TYPST_SOURCE_DIR}"
|
||||
OUT_DIR="${BUILD_DIR}"
|
||||
|
||||
rm -rf output
|
||||
mkdir -p output
|
||||
if [[ ! -d "$SRC_DIR" ]]; then
|
||||
echo "Source directory '$SRC_DIR' does not exist."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for FILE in "${LIST_OF_TYPST_FILES[@]}"; do
|
||||
typst compile "$FILE" output/"$(basename "${FILE%.*}").pdf"
|
||||
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"
|
||||
docker run --rm -v "$PWD":/work ghcr.io/typst/typst:latest compile "/work/$f" "/work/$dest_pdf"
|
||||
done
|
||||
7086
out/Analysis1.pdf
Normal file
7086
out/Analysis1.pdf
Normal file
File diff suppressed because one or more lines are too long
2471
out/Analysis_rewrite.pdf
Normal file
2471
out/Analysis_rewrite.pdf
Normal file
File diff suppressed because it is too large
Load Diff
@@ -862,7 +862,7 @@ endobj
|
||||
<<
|
||||
/Type /Font
|
||||
/Subtype /Type0
|
||||
/BaseFont /XNAUBQ+NewCMMath-Book-Identity-H
|
||||
/BaseFont /IZGNPX+LibertinusSerif-Bold-Identity-H
|
||||
/Encoding /Identity-H
|
||||
/DescendantFonts [87 0 R]
|
||||
/ToUnicode 90 0 R
|
||||
@@ -873,7 +873,7 @@ endobj
|
||||
<<
|
||||
/Type /Font
|
||||
/Subtype /CIDFontType0
|
||||
/BaseFont /XNAUBQ+NewCMMath-Book
|
||||
/BaseFont /IZGNPX+LibertinusSerif-Bold
|
||||
/CIDSystemInfo <<
|
||||
/Registry (Adobe)
|
||||
/Ordering (Identity)
|
||||
@@ -881,7 +881,7 @@ endobj
|
||||
>>
|
||||
/FontDescriptor 89 0 R
|
||||
/DW 0
|
||||
/W [0 0 500 1 1 389 2 2 970 3 3 278 4 4 412 5 5 389 6 6 278 7 7 778 8 8 1000 9 9 529 10 10 278 11 11 429 12 12 433 13 13 778 14 14 466 15 15 667 16 16 666 17 17 556 18 18 332 19 19 778 20 20 569 21 21 778 22 22 490 23 23 572 24 24 490 25 25 1000 26 27 422 28 28 722]
|
||||
/W [0 0 500 1 1 817 2 2 505.99997 3 3 325 4 4 542 5 5 521 6 6 428 7 7 598 8 8 581 9 9 489 10 10 256 11 11 899 12 12 551 13 13 616 14 14 322 15 15 561 16 16 736 17 17 905 18 18 358 19 19 529 20 20 316 21 21 427 22 22 456 23 23 619 24 24 732 25 25 716 26 26 551 27 27 367 28 28 312 29 29 504]
|
||||
>>
|
||||
endobj
|
||||
|
||||
@@ -891,162 +891,11 @@ endobj
|
||||
/Filter /FlateDecode
|
||||
>>
|
||||
stream
|
||||
xœûÿÿÿ | ||||