diff --git a/.github/actions/setup-rancher-cli/action.yml b/.github/actions/setup-rancher-cli/action.yml index 4cd13c4cc..bf29f9236 100644 --- a/.github/actions/setup-rancher-cli/action.yml +++ b/.github/actions/setup-rancher-cli/action.yml @@ -4,7 +4,6 @@ inputs: version: description: 'Version of Rancher CLI' required: false - default: 2.6.0 access-key: description: 'Rancher API access key' required: false @@ -22,8 +21,9 @@ inputs: runs: using: "composite" steps: - - run: | - TOOL_VERSION=${{ inputs.version }} + - shell: bash + run: | + TOOL_VERSION=${{ inputs.version != '' && inputs.version || env.DEFAULT_RANCHER_CLI_VERSION }} TOOL_NAME=rancher TOOL_REPO=rancher/cli TOOL_OS=$(uname | tr '[:upper:]' '[:lower:]') @@ -32,8 +32,11 @@ runs: | tar xz --strip=2 ./$TOOL_NAME-v$TOOL_VERSION/$TOOL_NAME sudo mv $TOOL_NAME /usr/local/bin/ echo $($TOOL_NAME --version) - shell: bash - - run: | + env: + DEFAULT_RANCHER_CLI_VERSION: 2.8.4 + + - shell: bash + run: | RANCHER2_BEARER_TOKEN=${{ inputs.access-key }}:${{ inputs.secret-key }} RANCHER2_URL=${{ inputs.url }} if [[ -n "$RANCHER2_BEARER_TOKEN" ]] @@ -41,14 +44,13 @@ runs: RANCHER_SYSTEM_CONTEXT_INDEX=$(echo 1 | rancher login $RANCHER2_URL -t $RANCHER2_BEARER_TOKEN | grep "$KUBECONTEXT" | grep System | cut -d ' ' -f1) echo $RANCHER_SYSTEM_CONTEXT_INDEX | rancher login $RANCHER2_URL -t $RANCHER2_BEARER_TOKEN > /dev/null fi - shell: bash env: KUBECONTEXT: ${{ inputs.context }} - - run: | + - shell: bash + run: | KUBECONTEXT="${{ inputs.context }}" if [[ -n "$KUBECONTEXT" ]] then mkdir -p $HOME/.kube && rancher cluster kubeconfig ${{ inputs.context }} > $HOME/.kube/config fi - shell: bash diff --git a/.updatecli/values/github_releases/rancher_cli.yaml b/.updatecli/values/github_releases/rancher_cli.yaml new file mode 100644 index 000000000..116e51a5c --- /dev/null +++ b/.updatecli/values/github_releases/rancher_cli.yaml @@ -0,0 +1,12 @@ +github: + prefix: 'build(deps)' + message: 'bump rancher-cli to {{ source "lastRelease" }}' + +github_release: + owner: 'rancher' + repo: 'cli' + +target: + file: '.github/actions/setup-rancher-cli/action.yml' + key: '$.runs.steps[0].env.DEFAULT_RANCHER_CLI_VERSION' + trimprefix: 'v' diff --git a/version.txt b/version.txt index 003349ad0..fa0bbb1b0 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v5.29.3 +v5.29.4