Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for ARM Runners #208

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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