Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,21 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Restore verda cache
uses: actions/cache@v5
with:
path: .verda-cache
key: verda-${{ hashFiles('VERSION') }}-${{ hashFiles('private-build-plans.toml') }}
restore-keys: |
verda-${{ hashFiles('VERSION') }}-

- name: Build font
env:
IMAGE_REF: ${{ needs.build-image.outputs.image-ref }}
VERDA_CACHE: .verda-cache
run: ./build.sh

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
with:
name: font-build
path: _output/${{ env.FONT_NAME }}-*.zip
Expand All @@ -115,7 +124,7 @@ jobs:
steps:
- uses: actions/checkout@v6

- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v8
with:
name: font-build
path: _output
Expand Down Expand Up @@ -156,13 +165,13 @@ jobs:
exit 1
fi

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
if: failure()
with:
name: visual-diffs
path: _diffs/

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v7
if: failure()
with:
name: visual-generated
Expand All @@ -183,7 +192,7 @@ jobs:
echo "VERSION=${VERSION}" >> "$GITHUB_ENV"

- name: Download font artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: font-build
path: _output
Expand Down
10 changes: 10 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ BUILD_PLAN=${BUILD_PLAN:-private-build-plans.toml}
OUTPUT_DIR=$(pwd)/_output
IMAGE=${IMAGE:-ghcr.io/awnion/custom-iosevka-nerd-font}
IMAGE_REF=${IMAGE_REF:-}
VERDA_CACHE=${VERDA_CACHE:-}

rm -rf "$OUTPUT_DIR"
mkdir -p "$OUTPUT_DIR"
Expand All @@ -34,9 +35,18 @@ fi

echo "Building font '$FONT_NAME' using plan '$BUILD_PLAN' ..."

CACHE_MOUNT=()
if [ -n "$VERDA_CACHE" ]; then
mkdir -p "$VERDA_CACHE"
VERDA_CACHE=$(cd "$VERDA_CACHE" && pwd)
echo "Using verda cache: $VERDA_CACHE"
CACHE_MOUNT=(-v "$VERDA_CACHE":${BUILD_DIR}/iosevka/.build)
fi

docker run --rm -t \
-v "$OUTPUT_DIR":/output \
-v "$(pwd)/$BUILD_PLAN":${BUILD_DIR}/iosevka/private-build-plans.toml:ro \
"${CACHE_MOUNT[@]}" \
"$IMAGE_REF" -c "\
cd ${BUILD_DIR}/iosevka && \
bun run build -- ttf::${FONT_NAME} && \
Expand Down