File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,17 @@ jobs:
2626 run : |
2727 # Remove the '-ec.X' suffix and only update if the prefix (upstream k0s release) has changed.
2828 export CURVERSION=$(make print-K0S_VERSION)
29- export VERSION=$(gh release list --repo k0sproject/k0s --json name,isLatest | jq -r '.[] | select(.isLatest)|.name')
29+ export CURMAJMIN=$(echo $CURVERSION | awk -F'.' '{print $1 "." $2}')
30+
31+ # pin to the latest release for the current major.minor version
32+ export VERSION=$(gh release list --repo k0sproject/k0s --exclude-pre-releases --json name,isLatest | \
33+ jq -r "[.[] | select(.name | startswith(\"$CURMAJMIN\"))] | first | .name")
34+
3035 if [ "$CURVERSION" != "$VERSION" ]; then
3136 sed -i "/^K0S_VERSION/c\K0S_VERSION = $VERSION" Makefile
32- sed -i "/^K0S_BINARY_SOURCE_OVERRIDE/c\K0S_BINARY_SOURCE_OVERRIDE =" Makefile
37+ sed -i "/^K0S_GO_VERSION/c\K0S_GO_VERSION = $VERSION" Makefile
38+ # replace the first occurrence of K0S_BINARY_SOURCE_OVERRIDE
39+ sed -i '0,/K0S_BINARY_SOURCE_OVERRIDE =.*/s/K0S_BINARY_SOURCE_OVERRIDE =.*/K0S_BINARY_SOURCE_OVERRIDE =/' Makefile
3340 make go.mod
3441 fi
3542 - name : Troubleshoot
You can’t perform that action at this time.
0 commit comments