Skip to content

Commit

Permalink
Download binary with right arch (#118)
Browse files Browse the repository at this point in the history
* Url based on arch 

Signed-off-by: Ludea <ludovicw35@hotmail.com>

* arm64 instead of aarch64 

Signed-off-by: Ludea <ludovicw35@hotmail.com>

* Default to amd64 

Signed-off-by: Ludea <ludovicw35@hotmail.com>

---------

Signed-off-by: Ludea <ludovicw35@hotmail.com>
  • Loading branch information
Ludea authored Apr 10, 2023
1 parent e878887 commit 2fffad3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,22 @@ install_chart_testing() {
fi

local arch
arch=$(uname -m)
if [[ $(uname -m) == "aarch64" ]]; then
arch=arm64
else
arch=amd64
fi
local cache_dir="$RUNNER_TOOL_CACHE/ct/$version/$arch"
local venv_dir="$cache_dir/venv"

if [[ ! -d "$cache_dir" ]]; then
mkdir -p "$cache_dir"

echo "Installing chart-testing ${version}..."
CT_CERT=https://github.com/helm/chart-testing/releases/download/$version/chart-testing_${version#v}_linux_amd64.tar.gz.pem
CT_SIG=https://github.com/helm/chart-testing/releases/download/$version/chart-testing_${version#v}_linux_amd64.tar.gz.sig
CT_CERT=https://github.com/helm/chart-testing/releases/download/$version/chart-testing_${version#v}_linux_$arch.tar.gz.pem
CT_SIG=https://github.com/helm/chart-testing/releases/download/$version/chart-testing_${version#v}_linux_$arch.tar.gz.sig

curl --retry 5 --retry-delay 1 -sSLo ct.tar.gz "https://github.com/helm/chart-testing/releases/download/$version/chart-testing_${version#v}_linux_amd64.tar.gz"
curl --retry 5 --retry-delay 1 -sSLo ct.tar.gz "https://github.com/helm/chart-testing/releases/download/$version/chart-testing_${version#v}_linux_$arch.tar.gz"
cosign verify-blob --certificate $CT_CERT --signature $CT_SIG \
--certificate-identity "https://github.com/helm/chart-testing/.github/workflows/release.yaml@refs/heads/main" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" ct.tar.gz
Expand Down

0 comments on commit 2fffad3

Please sign in to comment.