From 67a61a0d45aeed67bcd47632749292414b71a40b Mon Sep 17 00:00:00 2001 From: bbednarek Date: Wed, 15 Feb 2023 16:53:00 +0100 Subject: [PATCH 1/3] Download crane binary corresponding to underlying runner architecture --- action.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 7bd5dae..94e10bd 100644 --- a/action.yml +++ b/action.yml @@ -36,9 +36,11 @@ runs: os="Darwin" fi + arch=$(uname -m) + if [[ ! -z ${tag} ]]; then - echo "Installing crane @ ${tag} for ${os}" - curl -fsL https://github.com/google/go-containerregistry/releases/download/${tag}/go-containerregistry_${os}_x86_64.tar.gz | sudo tar xzf - -C /usr/local/bin crane + echo "Installing crane @ ${tag} for ${os} on ${arch}" + curl -fsL https://github.com/google/go-containerregistry/releases/download/${tag}/go-containerregistry_${os}_${arch}.tar.gz | sudo tar xzf - -C /usr/local/bin crane fi # NB: username doesn't seem to matter. From 77ab8b6716ce8a2e291cde15e470ef805272e0af Mon Sep 17 00:00:00 2001 From: bbednarek Date: Wed, 15 Feb 2023 17:19:05 +0100 Subject: [PATCH 2/3] handle aarch64 and arm64 --- action.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 94e10bd..43fedce 100644 --- a/action.yml +++ b/action.yml @@ -35,8 +35,11 @@ runs: if [[ $os == "macOS" ]]; then os="Darwin" fi - + arch=$(uname -m) + if [[ "arch" =~ (aarch64|arm64) ]] ; then + arch=arm64 + fi if [[ ! -z ${tag} ]]; then echo "Installing crane @ ${tag} for ${os} on ${arch}" From 8a78c724edf80c002d023e6e1d2735aff4a5144b Mon Sep 17 00:00:00 2001 From: bbednarek Date: Wed, 15 Feb 2023 17:27:44 +0100 Subject: [PATCH 3/3] fix env variable --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 43fedce..43aa4df 100644 --- a/action.yml +++ b/action.yml @@ -37,7 +37,7 @@ runs: fi arch=$(uname -m) - if [[ "arch" =~ (aarch64|arm64) ]] ; then + if [[ "$arch" =~ (aarch64|arm64) ]] ; then arch=arm64 fi