File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6868 tag="v$version"
6969 echo "is_prerelease=false" >> $GITHUB_OUTPUT
7070 else
71- tag="v$version-rc.${{ github.run_number }}"
71+ git fetch --tags --force
72+ existing_rc_tags=$(git tag -l "v$version-rc.*")
73+ if [ -z "$existing_rc_tags" ]; then
74+ next_rc=1
75+ else
76+ max_rc=$(echo "$existing_rc_tags" | sed -E 's/.*-rc\.([0-9]+)$/\1/' | sort -n | tail -1)
77+ next_rc=$((max_rc + 1))
78+ fi
79+ tag="v$version-rc.$next_rc"
7280 echo "is_prerelease=true" >> $GITHUB_OUTPUT
7381 fi
7482 echo "tag=$tag" >> $GITHUB_OUTPUT
Original file line number Diff line number Diff line change @@ -46,10 +46,10 @@ node scripts/bump-version.js [major|minor|patch]
4646
4747### Release types
4848
49- | Branch | Tag | Type |
50- | --------- | ------------------------ | --------------------------------- |
51- | ` main ` | ` v1.0.0 ` | Full release (marked as ` latest ` ) |
52- | ` staging ` | ` v1.0.0-rc.<run_number > ` | Release candidate (prerelease) |
49+ | Branch | Tag | Type |
50+ | --------- | --------------- | --------------------------------- |
51+ | ` main ` | ` v1.0.0 ` | Full release (marked as ` latest ` ) |
52+ | ` staging ` | ` v1.0.0-rc.<n > ` | Release candidate (prerelease) |
5353
5454### Artifacts
5555
You can’t perform that action at this time.
0 commit comments