Skip to content

Commit

Permalink
[FIX] Fix build.sh and cd-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesnulliu committed Dec 27, 2024
1 parent 2fbee9c commit 3d37be6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/cd-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

DEFAULT_FILENAME="main"
CONTENT_DIR="./contents"
CONTENT_DIR="contents"

show_usage() {
echo "Usage:"
Expand All @@ -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
Expand Down

0 comments on commit 3d37be6

Please sign in to comment.