Skip to content

Commit 9e3b6d7

Browse files
committed
Fix error in auto releaser
1 parent d6669fc commit 9e3b6d7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.github/workflows/auto-release.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,21 @@ jobs:
5757
# Define search patterns for each channel
5858
case "$CHANNEL" in
5959
nightly)
60-
SEARCH_PATTERN=".dev"
60+
SEARCH_PATTERN="dev"
6161
;;
6262
beta)
63-
SEARCH_PATTERN=".b"
63+
SEARCH_PATTERN="b"
6464
;;
6565
stable)
66-
# For stable, we want versions that don't contain .dev or .b
66+
# For stable, we want versions that don't contain dev or beta suffixes
6767
SEARCH_PATTERN="stable"
6868
;;
6969
esac
7070
7171
# Get the latest release for the channel
7272
if [ "$CHANNEL" = "stable" ]; then
73-
# For stable, get releases that don't contain .dev or .b
74-
LATEST_RELEASE=$(gh release list --exclude-drafts --limit 100 --json createdAt,tagName,isPrerelease --jq '.[] | select(.tagName | contains(".dev") | not) | select(.tagName | contains(".b") | not)' 2>/dev/null | jq -s '.[0]' || echo "")
73+
# For stable, get releases that don't contain dev or beta suffixes
74+
LATEST_RELEASE=$(gh release list --exclude-drafts --limit 100 --json createdAt,tagName,isPrerelease --jq '.[] | select(.tagName | contains("dev") | not) | select(.tagName | test("b[0-9]") | not)' 2>/dev/null | jq -s '.[0]' || echo "")
7575
else
7676
# For nightly and beta, filter by pattern
7777
LATEST_RELEASE=$(gh release list --exclude-drafts --limit 100 --json createdAt,tagName,isPrerelease --jq ".[] | select(.tagName | contains(\"$SEARCH_PATTERN\"))" 2>/dev/null | jq -s '.[0]' || echo "")
@@ -108,12 +108,12 @@ jobs:
108108
env:
109109
GH_TOKEN: ${{ github.token }}
110110

111-
- name: Get last stable release (for beta versioning)
111+
- name: Get last stable release (for beta and nightly versioning)
112112
id: last_stable
113-
if: steps.set_channel.outputs.channel == 'beta' || steps.set_channel.outputs.channel == 'nightly'
113+
if: ${{ steps.set_channel.outputs.channel == 'beta' || steps.set_channel.outputs.channel == 'nightly' }}
114114
run: |
115-
# Get the latest stable release (no .dev or .b)
116-
LATEST_STABLE=$(gh release list --exclude-drafts --limit 100 --json createdAt,tagName,isPrerelease --jq '.[] | select(.tagName | contains(".dev") | not) | select(.tagName | contains(".b") | not)' 2>/dev/null | jq -s '.[0]' || echo "")
115+
# Get the latest stable release (no dev or beta suffixes)
116+
LATEST_STABLE=$(gh release list --exclude-drafts --limit 100 --json createdAt,tagName,isPrerelease --jq '.[] | select(.tagName | contains("dev") | not) | select(.tagName | test("b[0-9]") | not)' 2>/dev/null | jq -s '.[0]' || echo "")
117117
118118
if [ -z "$LATEST_STABLE" ] || [ "$LATEST_STABLE" == "null" ]; then
119119
echo "No previous stable releases found"

0 commit comments

Comments
 (0)