Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix(charts/ci): fixing the publishing steps for helm chart

justina3b5112c1da8
diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml
index f0a43c83b..9dbfca459 100644
--- a/.github/workflows/helm-chart.yml
+++ b/.github/workflows/helm-chart.yml
@@ -6,12 +6,17 @@ on:
- "charts/kaneo/**"
- ".github/workflows/helm-chart.yml"
push:
- branches:
- - main
+ tags:
+ - "kaneo-*"
paths:
- "charts/kaneo/**"
- ".github/workflows/helm-chart.yml"
workflow_dispatch:
+ inputs:
+ version:
+ description: "Version to tag the images (e.g., 1.0.0)"
+ required: true
+ type: string
env:
CHART_PATH: charts/kaneo
@@ -82,6 +87,23 @@ jobs:
with:
persist-credentials: false
+ - name: Extract Version from Tag
+ run: |
+ if [[ $GITHUB_REF == refs/tags/* ]]; then
+ echo "CHART_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
+ else
+ echo "CHART_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
+ fi
+
+ - name: Update Chart Version
+ run: |
+ yq -i ".version = \"$CHART_VERSION\"" "$CHART_PATH/Chart.yaml"
+
+ - name: Publish chart
+ run: |
+ OWNER="${GITHUB_REPOSITORY_OWNER,,}"
+ helm push dist/kaneo-"$CHART_VERSION".tgz "oci://$REGISTRY/$OWNER/charts"
+
- name: Set up Helm
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5
@@ -95,16 +117,3 @@ jobs:
GH_ACTOR: ${{ github.actor }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "$GH_TOKEN" | helm registry login "$REGISTRY" --username "$GH_ACTOR" --password-stdin
-
- - name: Publish chart
- run: |
- OWNER="${GITHUB_REPOSITORY_OWNER,,}"
- CHART_VERSION=$(helm show chart "$CHART_PATH" | awk '/^version:/ { print $2 }')
- CHART_REF="oci://$REGISTRY/$OWNER/charts/kaneo"
-
- if helm show chart "$CHART_REF" --version "$CHART_VERSION" >/dev/null 2>&1; then
- echo "Chart $CHART_REF:$CHART_VERSION already exists; skipping publish."
- exit 0
- fi
-
- helm push dist/kaneo-"$CHART_VERSION".tgz "oci://$REGISTRY/$OWNER/charts"