|
@@ -489,25 +489,17 @@ jobs:
|
|
|
flavor="${{ matrix.flavor }}"
|
|
flavor="${{ matrix.flavor }}"
|
|
|
dir="/tmp/$flavor-src"
|
|
dir="/tmp/$flavor-src"
|
|
|
rm -rf "$dir"
|
|
rm -rf "$dir"
|
|
|
- # Mirror upstream checkout@v7 fetch-depth: 0 — pershoot manager build.gradle.kts
|
|
|
|
|
- # does `git describe --tags --long` + `rev-list --count` so shallow breaks at :78 toInt("")
|
|
|
|
|
- git clone --no-checkout --filter=blob:none "$repo" "$dir"
|
|
|
|
|
- # fetch tags + full history for this branch so describe/count work
|
|
|
|
|
- git -C "$dir" fetch --prune --tags --force origin "+refs/heads/${{ matrix.ref }}:refs/remotes/origin/${{ matrix.ref }}" 2>&1 | tail -5 || true
|
|
|
|
|
- git -C "$dir" fetch --depth=1 origin "$sha" 2>&1 | tail -5 || true
|
|
|
|
|
- # ensure tags are present even if shallow
|
|
|
|
|
- git -C "$dir" fetch --tags --depth=50 origin 2>&1 | tail -5 || true
|
|
|
|
|
|
|
+ # Mirror upstream checkout@v7 fetch-depth: 0 with all tags
|
|
|
|
|
+ # All 4 managers use git describe --tags --long / rev-list --count
|
|
|
|
|
+ git clone --no-checkout "$repo" "$dir"
|
|
|
|
|
+ # fetch all branches + all tags, full history (faithful to upstream)
|
|
|
|
|
+ git -C "$dir" fetch --prune --tags --force origin "+refs/heads/*:refs/remotes/origin/*" "+refs/tags/*:refs/tags/*" 2>&1 | tail -5 || true
|
|
|
git -C "$dir" checkout --detach "$sha"
|
|
git -C "$dir" checkout --detach "$sha"
|
|
|
- # if still no tags, unshallow
|
|
|
|
|
- if ! git -C "$dir" describe --tags --long HEAD >/dev/null 2>&1; then
|
|
|
|
|
- echo "No tags after shallow fetch — unshallowing"
|
|
|
|
|
- git -C "$dir" fetch --unshallow --tags 2>&1 | tail -10 || true
|
|
|
|
|
- fi
|
|
|
|
|
actual=$(git -C "$dir" rev-parse HEAD)
|
|
actual=$(git -C "$dir" rev-parse HEAD)
|
|
|
if [[ "$actual" != "$sha" ]]; then
|
|
if [[ "$actual" != "$sha" ]]; then
|
|
|
echo "Commit mismatch: expected $sha got $actual" >&2; exit 1
|
|
echo "Commit mismatch: expected $sha got $actual" >&2; exit 1
|
|
|
fi
|
|
fi
|
|
|
- echo "Cloned $flavor at $actual (describe: $(git -C "$dir" describe --tags --long HEAD 2>&1 | head -1))"
|
|
|
|
|
|
|
+ echo "Cloned $flavor at $actual (describe: $(git -C "$dir" describe --tags --long HEAD 2>&1 | head -1) count: $(git -C "$dir" rev-list --count HEAD 2>&1 | head -1) tags: $(git -C "$dir" tag | wc -l))"
|
|
|
echo "SRC_DIR=$dir" >> "$GITHUB_ENV"
|
|
echo "SRC_DIR=$dir" >> "$GITHUB_ENV"
|
|
|
|
|
|
|
|
# ── Stock build requirements per upstream — no edits except key ──
|
|
# ── Stock build requirements per upstream — no edits except key ──
|