From dc1dd8560d9dc1571e1eb96cef9990afea2a23a7 Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Sun, 19 Apr 2026 12:11:48 +0200 Subject: [PATCH] Add Git LFS installation step to CI workflow for improved reliability --- .../workflows/publish-faceai-container.yml | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/publish-faceai-container.yml b/.forgejo/workflows/publish-faceai-container.yml index 935101fb..ed2c720b 100644 --- a/.forgejo/workflows/publish-faceai-container.yml +++ b/.forgejo/workflows/publish-faceai-container.yml @@ -28,8 +28,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - lfs: true - name: Validate workflow variables run: | @@ -43,6 +41,37 @@ jobs: if [ ! -f "faceai/package.json" ]; then echo "faceai/package.json is missing from the repository checkout"; exit 1; fi if [ ! -f "bin/Face_Recognition_Unix/face_matcher" ]; then echo "bin/Face_Recognition_Unix/face_matcher is missing from the repository checkout"; exit 1; fi + - name: Ensure Git LFS exists + run: | + set -eu + if command -v git-lfs >/dev/null 2>&1; then + git-lfs version + exit 0 + fi + + if command -v apt-get >/dev/null 2>&1; then + apt-get update + apt-get install -y git-lfs + git-lfs version + exit 0 + fi + + ARCH="$(uname -m)" + case "${ARCH}" in + x86_64) LFS_ARCH="amd64" ;; + aarch64|arm64) LFS_ARCH="arm64" ;; + *) echo "Unsupported architecture for git-lfs bootstrap: ${ARCH}"; exit 1 ;; + esac + + GIT_LFS_VERSION="3.6.1" + curl -fsSL "https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-linux-${LFS_ARCH}-v${GIT_LFS_VERSION}.tar.gz" -o git-lfs.tgz + tar -xzf git-lfs.tgz + mkdir -p "${HOME}/.local/bin" + find . -type f -name git-lfs -exec cp {} "${HOME}/.local/bin/git-lfs" \; + chmod +x "${HOME}/.local/bin/git-lfs" + echo "${HOME}/.local/bin" >> "${GITHUB_PATH}" + "${HOME}/.local/bin/git-lfs" version + - name: Validate Git LFS checkout for matcher binary run: | set -eu