@@ -59,24 +59,20 @@ jobs:
5959 run : |
6060 CHART_VERSION="${{ github.event.inputs.chart_version }}"
6161 CHART_NAME="${{ github.event.inputs.chart_name }}"
62-
6362 # Validate chart version format
6463 if [[ ! "$CHART_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
6564 echo "Invalid chart version format. Use semantic versioning (e.g., 0.2.0)"
6665 exit 1
6766 fi
68-
6967 # Check if chart exists
7068 if [ ! -f "charts/$CHART_NAME/Chart.yaml" ]; then
7169 echo "Chart not found: charts/$CHART_NAME/Chart.yaml"
7270 exit 1
7371 fi
74-
7572 # Get current version and compare
7673 CURRENT_VERSION=$(yq eval '.version' "charts/$CHART_NAME/Chart.yaml")
7774 echo "Current chart version: $CURRENT_VERSION"
7875 echo "New chart version: $CHART_VERSION"
79-
8076 if [ "$CURRENT_VERSION" = "$CHART_VERSION" ]; then
8177 echo "Warning: New version is the same as current version"
8278 echo "This will still proceed but may not create a new release"
@@ -87,20 +83,15 @@ jobs:
8783 CHART_NAME="${{ github.event.inputs.chart_name }}"
8884 CHART_VERSION="${{ github.event.inputs.chart_version }}"
8985 APP_VERSION="${{ github.event.inputs.app_version }}"
90-
9186 CHART_FILE="charts/$CHART_NAME/Chart.yaml"
92-
9387 # Backup original
9488 cp "$CHART_FILE" "$CHART_FILE.backup"
95-
9689 # Update both chart version and appVersion
9790 yq eval '.version = "'$CHART_VERSION'"' -i "$CHART_FILE"
9891 yq eval '.appVersion = "'$APP_VERSION'"' -i "$CHART_FILE"
99-
10092 echo "Updated $CHART_FILE:"
10193 echo " Chart version: $CHART_VERSION"
10294 echo " App version: $APP_VERSION"
103-
10495 # Show the changes
10596 echo "Changes made:"
10697 diff "$CHART_FILE.backup" "$CHART_FILE" || true
@@ -113,11 +104,9 @@ jobs:
113104 - name : Validate Chart
114105 run : |
115106 CHART_NAME="${{ github.event.inputs.chart_name }}"
116-
117- # Install Helm is now handled by the previous step
107+ # Install Helm is now handled by the previous step
118108 echo "Testing template generation..."
119109 helm template test-release charts/$CHART_NAME > /dev/null
120-
121110 echo "Chart validation passed!"
122111
123112 - name : Commit Changes
@@ -127,15 +116,12 @@ jobs:
127116 APP_VERSION="${{ github.event.inputs.app_version }}"
128117 RELEASE_TYPE="${{ github.event.inputs.release_type }}"
129118 RELEASE_NOTES="${{ github.event.inputs.release_notes }}"
130-
131119 git add charts/$CHART_NAME/Chart.yaml
132-
133120 if git diff --staged --quiet; then
134121 echo "No changes to commit"
135122 echo "skip_release=true" >> $GITHUB_ENV
136123 exit 0
137124 fi
138-
139125 git commit -m "Release $CHART_NAME chart v$CHART_VERSION"
140126
141127 - name : Push Changes
@@ -154,7 +140,6 @@ jobs:
154140 run : |
155141 CHART_VERSION="${{ github.event.inputs.chart_version }}"
156142 RELEASE_TYPE="${{ github.event.inputs.release_type }}"
157-
158143 echo "Chart Release Completed Successfully!"
159144 echo ""
160145 echo "Chart: ${{ github.event.inputs.chart_name }}"
0 commit comments