@@ -50,12 +50,12 @@ runs:
5050 distribution : temurin
5151 java-version : ${{ inputs.java-version }}
5252
53- # Cache the plus-fop bundle by exact version
53+ # Cache the plus-fop bundle by version (folder name may vary; cache pattern uses a glob)
5454 - name : Restore ditac (plus-fop) cache
5555 id : cache-ditac
5656 uses : actions/cache@v4
5757 with :
58- path : ditac-${{ inputs.ditac-version }}-plus-fop *
58+ path : ditac-${{ inputs.ditac-version }}*
5959 key : ditac-${{ inputs.ditac-version }}-plus-fop
6060
6161 - name : Download ditac (plus-fop)
@@ -69,20 +69,28 @@ runs:
6969 curl -fsSL -o ditac.zip "$URL"
7070 unzip -q ditac.zip
7171 rm -f ditac.zip
72+ echo "Top-level after unzip:"
73+ ls -lah
7274
73- - name : Locate ditac directory and add to PATH
75+ - name : Locate ditac directory and add to PATH (robust)
7476 shell : bash
7577 run : |
7678 set -euo pipefail
77- DITAC_DIR="$(find . -maxdepth 1 -type d -name "ditac-${{ inputs.ditac-version }}-plus-fop*" | head -n1)"
78- if [[ -z "${DITAC_DIR:-}" ]]; then
79- echo "Could not find ditac directory after unzip." >&2
79+ # Find the actual ditac launcher regardless of folder naming
80+ CANDIDATE="$(find "$GITHUB_WORKSPACE" -maxdepth 3 -type f -path "*/bin/ditac" | head -n1 || true)"
81+ if [[ -z "${CANDIDATE:-}" ]]; then
82+ echo "Could not find bin/ditac after unzip." >&2
83+ echo "Workspace tree for debugging:" >&2
84+ ls -R || true
8085 exit 1
8186 fi
82- echo "Using $DITAC_DIR"
87+ DITAC_DIR="$(dirname "$(dirname "$CANDIDATE")")"
88+ echo "Using ditac in: $DITAC_DIR"
8389 echo "DITAC_DIR=$DITAC_DIR" >> "$GITHUB_ENV"
84- echo "$GITHUB_WORKSPACE/$DITAC_DIR/bin" >> "$GITHUB_PATH"
85- ditac -version || true
90+ # Ensure executable bit (some zips can drop it)
91+ chmod +x "$DITAC_DIR/bin/ditac" || true
92+ echo "$DITAC_DIR/bin" >> "$GITHUB_PATH"
93+ "$DITAC_DIR/bin/ditac" -version || true
8694
8795 - name : Ensure directories
8896 shell : bash
0 commit comments