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:
parent
0757d9d8ce
commit
c028e04b0d
1 changed files with 6 additions and 3 deletions
9
.github/workflows/build-arm64.yml
vendored
9
.github/workflows/build-arm64.yml
vendored
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue