Skip to content

Commit 2c7499d

Browse files
feat: disregard -ec.X suffix when bumping k0s (#238)
* feat: disregard -ec.X suffix when bumping k0s if we are shipping our own version of k0s we should only bump k0s dependency when the prefix (whatever comes before -ec.X) has been updated. we also need to clear the download url used. * feat: using awk
1 parent e966fad commit 2c7499d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/dependencies.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ jobs:
3333
sed -i "/^K0SCTL_VERSION/c\K0SCTL_VERSION = $VERSION" Makefile
3434
- name: K0s
3535
run: |
36+
# Remove the '-ec.X' suffix and only update if the prefix (upstream k0s release) has changed.
37+
export CURVERSION=$(awk '/^K0S_VERSION/{split($3,a,"-"); print a[1]}' Makefile)
3638
export VERSION=`curl https://api.github.com/repos/k0sproject/k0s/releases/latest | jq -r .name`
37-
sed -i "/^K0S_VERSION/c\K0S_VERSION = $VERSION" Makefile
39+
if [ "$CURVERSION" != "$VERSION" ]; then
40+
sed -i "/^K0S_VERSION/c\K0S_VERSION = $VERSION" Makefile
41+
sed -i "/^K0S_BINARY_SOURCE_OVERRIDE/c\K0S_BINARY_SOURCE_OVERRIDE =" Makefile
42+
fi
3843
- name: Troubleshoot
3944
run: |
4045
export VERSION=`curl https://api.github.com/repos/replicatedhq/troubleshoot/releases/latest | jq -r .name`

0 commit comments

Comments
 (0)