Skip to content

Commit

Permalink
.github: package unstable Helm charts, too.
Browse files Browse the repository at this point in the history
In addition to tagged releases, also create 'unstable' Helm
charts from main and release-* branches.

Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Dec 20, 2023
1 parent c9ae08a commit 2ba5874
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/package-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Package Helm charts

on:
push:
branches:
- main
- release-*
tags:
- "v*.*.*"

Expand All @@ -22,10 +25,28 @@ jobs:

- name: Package Helm charts
run: |
helm package --version "$GITHUB_REF_NAME" --app-version "$GITHUB_REF_NAME" "$CHARTS_DIR"/*
GITREF=${{ github.ref }}
case $GITREF in
refs/tags/v*)
version="v${GITREF#refs/tags/}"
;;
refs/heads/main)
version=unstable
;;
refs/heads/release-*)
version="v${GITREF#refs/heads/release-}-unstable"
;;
*)
echo "error: can't determine Helm chart version."
exit 1
;;
esac
echo "- Packaging Helm charts for version $version..."
helm package --version "$version" --app-version "$version" "$CHARTS_DIR"/*
find . -name '*.tgz' -print | while read SRC_FILE; do
DEST_FILE=$(echo $SRC_FILE | sed 's/v/helm-chart-v/g')
mv $SRC_FILE $DEST_FILE
echo " - created chart $DEST_FILE..."
done
- name: Upload Helm packages to GitHub releases
Expand Down

0 comments on commit 2ba5874

Please sign in to comment.