Skip to content

Commit 6a5262f

Browse files
committed
Try to clean version
1 parent a2b396a commit 6a5262f

File tree

2 files changed

+21
-60
lines changed

2 files changed

+21
-60
lines changed

.github/workflows/compare-versions/action.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/install-valkey/action.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,37 @@ runs:
6060
make install
6161
fi
6262
echo 'export PATH=/usr/local/bin:$PATH' >>~/.bash_profile
63+
64+
- name: Clean version
65+
shell: bash
66+
id: cleaned_version
67+
run: |
68+
# Remove any prefix like "redis-"
69+
cleaned_version=$(echo "${{ inputs.engine-version }}" | sed 's/^redis-//')
70+
echo "result=$cleaned_version" >> $GITHUB_OUTPUT
71+
echo "Cleaned version from ${{ inputs.engine-version }} to $cleaned_version"
6372
6473
- name: Check if the current version is a Valkey release
65-
id: is_valkey_release
66-
uses: ./.github/workflows/compare-versions
74+
uses: madhead/semver-utils@latest
75+
id: version
76+
needs: cleaned_version
6777
with:
68-
# Checks if the current tested version is a Valkey release (>= 7.2.5)
69-
version1: ${{ inputs.engine-version }}
70-
version2: ${{ env.VALKEY_MIN_VERSION }}
78+
# Checks if the current tested version is a Valkey release (>= 7.2.5)
79+
version: ${{ steps.cleaned_version.outputs.result }}
80+
compare-to: ${{ env.VALKEY_MIN_VERSION }}
7181

7282
- name: Verify Valkey installation and symlinks
83+
needs: version
7384
shell: bash
7485
run: |
7586
# In Valkey releases, the engine is built with symlinks from valkey-server and valkey-cli
7687
# to redis-server and redis-cli. This step ensures that the engine is properly installed
7788
# with the expected version and that Valkey symlinks are correctly created.
78-
79-
IS_VALKEY=${{ steps.is_valkey_release.outputs.result }}
89+
if [[ "${{ steps.version.outputs.comparison-result }}" == "<" ]]; then
90+
IS_VALKEY=false;
91+
else
92+
IS_VALKEY=true;
93+
fi
8094
EXPECTED_VERSION=`echo ${{ inputs.engine-version }} | sed -e "s/^redis-//"`
8195
REDIS_SERVER_VER=$(redis-server -v)
8296
if [[ $IS_VALKEY == "true" ]]; then

0 commit comments

Comments
 (0)