diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f7646f7..6c3ac9b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -36,19 +36,22 @@ jobs: - name: Build or restore resvg-js for FreeBSD run: | RESVG_VER=$(node -e "process.stdout.write(require('./node_modules/@resvg/resvg-js/package.json').version)") + # The loader expects a versioned filename: resvgjs.freebsd-x64-${RESVG_VER}.node CACHE_FILE=/usr/local/git/.cache/resvg-freebsd/resvgjs.freebsd-x64-${RESVG_VER}.node + TARGET_FILE=node_modules/@resvg/resvg-js/resvgjs.freebsd-x64-${RESVG_VER}.node if [ -f "$CACHE_FILE" ]; then echo "Restoring cached resvg-js ${RESVG_VER}" mkdir -p node_modules/@resvg/resvg-js/ - cp "$CACHE_FILE" node_modules/@resvg/resvg-js/resvgjs.freebsd-x64.node + cp "$CACHE_FILE" "$TARGET_FILE" else echo "Building resvg-js ${RESVG_VER} from source..." npm install --build-from-source @resvg/resvg-js mkdir -p /usr/local/git/.cache/resvg-freebsd - BUILT=$(find node_modules/@resvg/resvg-js -name "resvgjs.freebsd-x64.node" | head -1) + BUILT=$(find node_modules/@resvg/resvg-js -name "resvgjs.freebsd-x64-*.node" | head -1) if [ -n "$BUILT" ]; then cp "$BUILT" "$CACHE_FILE" - echo "Cached resvg-js binary at $CACHE_FILE" + cp "$BUILT" "$TARGET_FILE" + echo "Cached resvg-js binary at $CACHE_FILE and copied to $TARGET_FILE" fi fi