From 3d37be65eeeb067bb19c6574f41564a051646871 Mon Sep 17 00:00:00 2001 From: jamesnulliu Date: Fri, 27 Dec 2024 15:32:26 +0000 Subject: [PATCH] [FIX] Fix build.sh and cd-release.yml --- .github/workflows/cd-release.yml | 4 +--- scripts/build.sh | 8 +++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cd-release.yml b/.github/workflows/cd-release.yml index 96bacd8..f76e5bc 100644 --- a/.github/workflows/cd-release.yml +++ b/.github/workflows/cd-release.yml @@ -20,9 +20,7 @@ jobs: - name: Validate version and branch run: | - BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) - TAG_NAME=${{ github.ref_name }} - if [[ "$BRANCH_NAME" == "master" && ! "$TAG_NAME" =~ ^v3\. ]]; then + if [[ ! "$TAG_NAME" =~ ^v3\. ]]; then echo "Error: Tags on master branch must start with v3." exit 1 fi diff --git a/scripts/build.sh b/scripts/build.sh index 3b76cd7..a7db83a 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,7 +1,7 @@ #!/bin/bash DEFAULT_FILENAME="main" -CONTENT_DIR="./contents" +CONTENT_DIR="contents" show_usage() { echo "Usage:" @@ -14,16 +14,14 @@ show_usage() { single_compile() { local filename=$1 - mkdir -p build - cp -r $CONTENT_DIR build/ + mkdir -p build/$CONTENT_DIR xelatex -synctex=1 -interaction=nonstopmode -file-line-error -output-directory=build "$filename" || exit 1 echo "Single compilation completed successfully!" } full_compile() { local filename=$1 - mkdir -p build - cp -r $CONTENT_DIR build/ + mkdir -p build/$CONTENT_DIR xelatex -synctex=1 -interaction=nonstopmode -file-line-error -output-directory=build "$filename" || exit 1 bibtex "build/$filename" || exit 1 xelatex -synctex=1 -interaction=nonstopmode -file-line-error -output-directory=build "$filename" || exit 1