Skip to content

Commit 81cd1c2

Browse files
Merge pull request #110 from Chia-Network/rc-version-logic-fix
ci: fix rc version tag logic
2 parents 4c397d1 + f654ad4 commit 81cd1c2

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

.github/workflows/auto-release-rc.yml

+12-9
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,21 @@ jobs:
3434
run: |
3535
stable_version=$(gh release list --limit 1 --order desc --exclude-pre-releases --json tagName --jq ".[].tagName")
3636
echo "Latest release is $stable_version"
37-
rc_version=$(gh release list --json tagName --jq ".[] | select(.tagName | test(\"${version}-rc*\")) | .tagName")
38-
echo "Latest release candidate is $rc_version"
3937
40-
if [[ -z ${rc_version} ]]; then
41-
# Extract the major, minor, and patch versions
42-
IFS='.' read -r major minor patch <<< "$stable_version"
38+
# Extract the major, minor, and patch versions
39+
IFS='.' read -r major minor patch <<< "$stable_version"
4340
44-
# Increment the patch version
45-
new_patch=$((patch + 1))
41+
# Increment the patch version
42+
new_patch=$((patch + 1))
4643
47-
# Construct the new version string
48-
version="$major.$minor.$new_patch-rc1"
44+
new_version="$major.$minor.$new_patch"
45+
46+
rc_version=$(gh release list --json tagName --jq ".[] | select(.tagName | test(\"${new_version}-rc*\")) | .tagName")
47+
echo "Latest release candidate is $rc_version"
48+
49+
if [[ -z ${rc_version} ]]; then
50+
# Construct the new version string using new_version
51+
version="${new_version}-rc1"
4952
5053
echo "New version: $version"
5154

0 commit comments

Comments
 (0)