Skip to content

Commit 77d9a99

Browse files
immanuwelltklauser
authored andcommitted
fix: select released CLI asset by runner platform
Signed-off-by: immanuwell <pchpr.00@list.ru>
1 parent 7217caa commit 77d9a99

1 file changed

Lines changed: 29 additions & 4 deletions

File tree

action.yaml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,40 @@ runs:
8888
# to avoid building the binary as root, which would cause issues with caching.
8989
sudo mv ${TARGET} ${{ inputs.binary-dir }}/${{ inputs.binary-name }}
9090
91+
- name: Resolve Released Cilium CLI Archive
92+
if: ${{ steps.target.outputs.release != '' }}
93+
id: release-asset
94+
shell: bash
95+
run: |
96+
case "${{ runner.os }}" in
97+
Linux) os=linux ;;
98+
macOS) os=darwin ;;
99+
*)
100+
echo "Unsupported runner OS for released cilium-cli binaries: ${{ runner.os }}"
101+
exit 1
102+
;;
103+
esac
104+
105+
case "${{ runner.arch }}" in
106+
X64) arch=amd64 ;;
107+
ARM64) arch=arm64 ;;
108+
*)
109+
echo "Unsupported runner architecture for released cilium-cli binaries: ${{ runner.arch }}"
110+
exit 1
111+
;;
112+
esac
113+
114+
echo "archive=cilium-${os}-${arch}.tar.gz" >> "$GITHUB_OUTPUT"
115+
91116
- name: Install Released Cilium CLI
92117
if: ${{ steps.target.outputs.release != '' }}
93118
shell: bash
94119
run: |
95-
curl -sSL --remote-name-all https://github.com/${{ inputs.repository }}/releases/download/${{ inputs.release-version }}/cilium-linux-amd64.tar.gz{,.sha256sum}
96-
sha256sum --check cilium-linux-amd64.tar.gz.sha256sum
97-
tar xzvfC cilium-linux-amd64.tar.gz /tmp
120+
curl -sSL --remote-name-all https://github.com/${{ inputs.repository }}/releases/download/${{ inputs.release-version }}/${{ steps.release-asset.outputs.archive }}{,.sha256sum}
121+
sha256sum --check ${{ steps.release-asset.outputs.archive }}.sha256sum
122+
tar xzvfC ${{ steps.release-asset.outputs.archive }} /tmp
98123
sudo mv /tmp/cilium ${{ inputs.binary-dir }}/${{ inputs.binary-name }}
99-
rm cilium-linux-amd64.tar.gz{,.sha256sum}
124+
rm ${{ steps.release-asset.outputs.archive }}{,.sha256sum}
100125
101126
- name: Install Cilium CLI from CI
102127
if: ${{ steps.target.outputs.ci_image != '' }}

0 commit comments

Comments
 (0)