Skip to content

Commit f7a082c

Browse files
committed
fix(workflow): get github version
1 parent d6522cf commit f7a082c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

_scripts/install-cli.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ init_arch() {
3939
}
4040

4141
init_latest_version() {
42-
VERSION=$(curl -Ls $DRYCC_BIN_URL_BASE|grep /drycc/workflow-cli/releases/tag/ | grep -v no-underline | head -n 1 | cut -d '"' -f 2| awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}')
42+
VERSION=$(curl -Ls $DRYCC_BIN_URL_BASE|grep /drycc/workflow-cli/releases/tag/ | sed -E 's/.*\/drycc\/workflow-cli\/releases\/tag\/(v[0-9\.]+)".*/\1/g' | head -1)
4343
}
4444

4545
init_arch

_scripts/install.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ init_arch
2828

2929
function install_helm {
3030
if [[ "${INSTALL_DRYCC_MIRROR}" == "cn" ]] ; then
31-
version=$(curl -Ls https://github.com/helm/helm/releases|grep /helm/helm/releases/tag/ | grep -v no-underline | head -n 1 | cut -d '"' -f 2| awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}')
31+
version=$(curl -Ls https://github.com/helm/helm/releases|grep /helm/helm/releases/tag/ | sed -E 's/.*\/helm\/helm\/releases\/tag\/(v[0-9\.]+)".*/\1/g' | head -1)
3232
tar_name="helm-${version}-linux-${ARCH}.tar.gz"
3333
helm_download_url="https://github.com/helm/${tar_name}"
3434
else
35-
version=$(curl -Ls https://github.com/helm/helm/releases|grep /helm/helm/releases/tag/ | grep -v no-underline | head -n 1 | cut -d '"' -f 2| awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}')
35+
version=$(curl -Ls https://github.com/helm/helm/releases|grep /helm/helm/releases/tag/ | sed -E 's/.*\/helm\/helm\/releases\/tag\/(v[0-9\.]+)".*/\1/g' | head -1)
3636
tar_name="helm-${version}-linux-${ARCH}.tar.gz"
3737
helm_download_url="https://get.helm.sh/${tar_name}"
3838
fi
@@ -109,7 +109,7 @@ function install_cin_plugins {
109109
else
110110
cni_plugins_url="https://github.com/containernetworking/plugins/releases"
111111
fi
112-
version=$(curl -Ls ${cni_plugins_url}|grep /containernetworking/plugins/releases/tag/ | grep -v no-underline | head -n 1 | cut -d '"' -f 2| awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}')
112+
version=$(curl -Ls ${cni_plugins_url}|grep /containernetworking/plugins/releases/tag/ | sed -E 's/.*\/containernetworking\/plugins\/releases\/tag\/(v[0-9\.]+)".*/\1/g' | head -1)
113113
tar_name="cni-plugins-linux-${ARCH}-$version.tgz"
114114
download_url="${cni_plugins_url}/download/${version}/${tar_name}"
115115
curl -fsSL -o "${tar_name}" "${download_url}"

0 commit comments

Comments
 (0)