Skip to content

Commit

Permalink
feat: add option --skip-upload, to not handle index.yaml for OCI charts
Browse files Browse the repository at this point in the history
Signed-off-by: acuD1 <[email protected]>
  • Loading branch information
acuD1 committed May 15, 2023
1 parent 5f8660e commit be66f97
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ inputs:
skip_existing:
description: "Skip package upload if release exists"
required: false
skip_upload:
description: "Skip package upload"
required: false
mark_as_latest:
description: Mark the created GitHub release as 'latest'
required: false
Expand Down Expand Up @@ -72,6 +75,10 @@ runs:
args+=(--skip-existing "${{ inputs.skip_existing }}")
fi
if [[ -n "${{ inputs.skip_upload }}" ]]; then
args+=(--skip-upload "${{ inputs.skip_upload }}")
fi
if [[ -n "${{ inputs.mark_as_latest }}" ]]; then
args+=(--mark-as-latest "${{ inputs.mark_as_latest }}")
fi
Expand Down
18 changes: 16 additions & 2 deletions cr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Usage: $(basename "$0") <options>
-i, --install-only Just install the cr tool
-s, --skip-packaging Skip the packaging step (run your own packaging before using the releaser)
--skip-existing Skip package upload if release exists
--skip-upload Skip package upload, just create the release. Note needed in case of OCI upload.
-l, --mark-as-latest Mark the created GitHub release as 'latest' (default: true)
EOF
}
Expand All @@ -48,6 +49,7 @@ main() {
local install_only=
local skip_packaging=
local skip_existing=
local skip_upload=
local mark_as_latest=true

parse_command_line "$@"
Expand Down Expand Up @@ -85,7 +87,10 @@ main() {
done

release_charts
update_index

if [[ -z "$skip_upload" ]]; then
update_index
fi
else
echo "Nothing to do. No chart changes detected."
fi
Expand All @@ -94,7 +99,10 @@ main() {
rm -rf .cr-index
mkdir -p .cr-index
release_charts
update_index

if [[ -z "$skip_upload" ]]; then
update_index
fi
fi

popd > /dev/null
Expand Down Expand Up @@ -181,6 +189,12 @@ parse_command_line() {
shift
fi
;;
--skip-upload)
if [[ -n "${2:-}" ]]; then
skip_upload="$2"
shift
fi
;;
-l|--mark-as-latest)
if [[ -n "${2:-}" ]]; then
mark_as_latest="$2"
Expand Down

0 comments on commit be66f97

Please sign in to comment.