ci(actions): fix version suffix accumulation in build-arm64

This commit modifies the version determination step to strip any existing '-fork-[0-9]+' suffixes from the base Git tag before appending the new run number. This prevents tags from accumulating incorrectly (e.g. from 'v0.1.2-fork-02-fork-04').
This commit is contained in:
muava12 2026-02-22 12:03:36 +08:00
parent 0757d9d8ce
commit c028e04b0d

View file

@ -37,16 +37,19 @@ jobs:
- name: Determine Fork Version - name: Determine Fork Version
id: version id: version
run: | run: |
# Dapatkan tag terbaru dari repo asli (misal: v0.1.2) # Dapatkan tag terbaru dari history (mungkin sudah ada akhiran -fork)
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
# Hilangkan akhiran -fork-* agar kita mendapatkan base version aslinya (misal: v0.1.2)
BASE_TAG=$(echo "$LATEST_TAG" | sed -E 's/-fork-[0-9]+//g')
# Format increment number menggunakan run number (misal: 01, 02) # Format increment number menggunakan run number (misal: 01, 02)
RUN_NUM=$(printf "%02d" ${{ github.run_number }}) RUN_NUM=$(printf "%02d" ${{ github.run_number }})
# Gabungkan menjadi versi custom untuk fork # Gabungkan menjadi versi custom untuk fork
FORK_VERSION="${LATEST_TAG}-fork-${RUN_NUM}" FORK_VERSION="${BASE_TAG}-fork-${RUN_NUM}"
echo "Ditemukan tag upstream: $LATEST_TAG" echo "Ditemukan tag asli: $BASE_TAG"
echo "Versi fork yang digunakan: $FORK_VERSION" echo "Versi fork yang digunakan: $FORK_VERSION"
echo "FORK_VERSION=$FORK_VERSION" >> $GITHUB_ENV echo "FORK_VERSION=$FORK_VERSION" >> $GITHUB_ENV