diff --git a/.gitea/workflows/build-windows-cross-linux.yml b/.gitea/workflows/build-windows-cross-linux.yml index d8ebea8..02b1576 100644 --- a/.gitea/workflows/build-windows-cross-linux.yml +++ b/.gitea/workflows/build-windows-cross-linux.yml @@ -34,16 +34,18 @@ jobs: run: | set -euo pipefail dnf install -y git rsync + WORKDIR="$(pwd)" + SRC_DIR="$(mktemp -d /tmp/chengnan-source.XXXXXX)" REPO_URL="${GITHUB_SERVER_URL:-https://git.luochen570.cn}/${GITHUB_REPOSITORY}.git" - TOKEN="${GITHUB_TOKEN:-${GITEA_TOKEN:-}}" + TOKEN="${GITHUB_TOKEN:-}" if [ -n "$TOKEN" ]; then git -c http.extraHeader="Authorization: token ${TOKEN}" \ - clone --depth 1 --branch "${GITHUB_REF_NAME:-main}" "$REPO_URL" source + clone --depth 1 --branch "${GITHUB_REF_NAME:-main}" "$REPO_URL" "$SRC_DIR" else - git clone --depth 1 --branch "${GITHUB_REF_NAME:-main}" "$REPO_URL" source + git clone --depth 1 --branch "${GITHUB_REF_NAME:-main}" "$REPO_URL" "$SRC_DIR" fi - rsync -a --delete source/ ./ - rm -rf source + rsync -a --delete "$SRC_DIR/" "$WORKDIR/" + rm -rf "$SRC_DIR" - name: Install cross build dependencies run: |