-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pick up k0s_sort version from go.mod in CI
The GitHub runners ship with _some_ go toolchain installed by default. This will be enough to figure out the k0s_sort version from go.mod. Download and use the newly available pre-built binary instead compiling it on the fly. Signed-off-by: Tom Wieczorek <[email protected]>
- Loading branch information
Showing
4 changed files
with
14 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,17 +27,16 @@ jobs: | |
cache: pip | ||
cache-dependency-path: docs/requirements.txt | ||
|
||
- name: Set up Go ${{ env.GO_VERSION }} | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install --disable-pip-version-check -r docs/requirements_pip.txt | ||
pip --version | ||
pip install --disable-pip-version-check -r docs/requirements.txt | ||
go install github.com/k0sproject/version/cmd/[email protected] | ||
k0sSortVersion="$(go list -m -f '{{.Version}}' github.com/k0sproject/version)" | ||
mkdir -p build/cache/bin | ||
curl -sSLo build/cache/bin/k0s_sort --retry 5 --retry-all-errors "https://github.com/k0sproject/version/releases/download/$k0sSortVersion/k0s_sort-linux-amd64" | ||
echo PATH="$(realpath build/cache/bin):$PATH" >>"$GITHUB_ENV" | ||
- name: Generate docs | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,20 +5,16 @@ | |
# ./gen-matrix.sh 1.24.2 1.24.3 | ||
# Output: ["v1.24.2+k0s.0", "v1.24.3+k0s.0"] | ||
|
||
set -e -o pipefail | ||
set -euo pipefail | ||
|
||
list_k0s_releases() { | ||
# shellcheck disable=SC2016 | ||
local query='.[] | select(.prerelease == false and .draft == false) | .name | select(startswith($ENV.VERSION_PREFIX))' | ||
VERSION_PREFIX="v$1" gh api -X GET /repos/k0sproject/k0s/releases -F per_page=100 --paginate --jq "$query" | ||
} | ||
|
||
k0s_sort() { | ||
go run github.com/k0sproject/version/cmd/[email protected] | ||
} | ||
|
||
latest_release() { | ||
list_k0s_releases "$1" | k0s_sort | tail -1 | ||
list_k0s_releases "$1" | k0s_sort -l | ||
} | ||
|
||
json_print_latest_releases() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,11 +10,8 @@ TESTS=${1:-check-ap-ha3x3} | |
VERSIONS="$2" | ||
ARCH=${TARGET_ARCH:-amd64} | ||
|
||
go install github.com/k0sproject/version/cmd/[email protected] | ||
GOBIN="$(go env GOPATH)/bin" | ||
|
||
if [[ -z "$VERSIONS" ]]; then | ||
RELEASE=$(gh release list -L 100 -R k0sproject/k0s | grep "+k0s." | grep -v Draft | cut -f 1 | $GOBIN/k0s_sort | tail -1) | ||
RELEASE=$(gh release list -L 100 -R k0sproject/k0s | grep "+k0s." | grep -v Draft | cut -f 1 | k0s_sort -l) | ||
VERSIONS=$RELEASE | ||
fi | ||
|
||
|