Skip to content

Commit

Permalink
Adding support for ARM runners
Browse files Browse the repository at this point in the history
  • Loading branch information
dmurphyfa committed Aug 14, 2024
1 parent d1e09fd commit 2518685
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ runs:
if [[ -n "${{ inputs.pages_branch }}" ]]; then
args+=(--pages-branch "${{ inputs.pages_branch }}")
fi
if [ "${{ runner.arch }}" == "ARM64" ]; then
args+=(--use-arm "true")
fi
"$GITHUB_ACTION_PATH/cr.sh" "${args[@]}"
if [[ -f changed_charts.txt ]]; then
Expand Down
15 changes: 13 additions & 2 deletions cr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Usage: $(basename "$0") <options>
--skip-upload Skip package upload, just create the release. Not needed in case of OCI upload.
-l, --mark-as-latest Mark the created GitHub release as 'latest' (default: true)
--packages-with-index Upload chart packages directly into publishing branch
--use-arm Use ARM64 binary (default: false)
EOF
}

Expand All @@ -55,6 +56,7 @@ main() {
local mark_as_latest=true
local packages_with_index=false
local pages_branch=
local use_arm=false

parse_command_line "$@"

Expand Down Expand Up @@ -218,6 +220,12 @@ parse_command_line() {
shift
fi
;;
--use-arm)
if [[ -n "${2:-}" ]]; then
use_arm="$2"
shift
fi
;;
*)
break
;;
Expand Down Expand Up @@ -259,9 +267,12 @@ install_chart_releaser() {

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

architecture=linux_amd64
if [[ "$use_arm" = true ]]; then
architecture=linux_arm64
fi
echo "Installing chart-releaser on $install_dir..."
curl -sSLo cr.tar.gz "https://github.com/helm/chart-releaser/releases/download/$version/chart-releaser_${version#v}_linux_amd64.tar.gz"
curl -sSLo cr.tar.gz "https://github.com/helm/chart-releaser/releases/download/$version/chart-releaser_${version#v}_${architecture}.tar.gz"
tar -xzf cr.tar.gz -C "$install_dir"
rm -f cr.tar.gz
fi
Expand Down

0 comments on commit 2518685

Please sign in to comment.