Fix Helm chart build workflow issues
- Removed unnecessary helm dependency update (no dependencies defined) - Modified packaging to use a temporary copy of the chart - This prevents sed modifications from affecting the lint step - Ensures Chart.yaml version field remains intact - Added debug output for chart version verification
This commit is contained in:
@@ -95,11 +95,6 @@ jobs:
|
||||
with:
|
||||
version: "latest"
|
||||
|
||||
- name: Update Chart dependencies
|
||||
run: |
|
||||
cd helm/api7ee
|
||||
helm dependency update
|
||||
|
||||
- name: Lint Helm chart
|
||||
run: |
|
||||
helm lint helm/api7ee/
|
||||
@@ -108,13 +103,17 @@ jobs:
|
||||
run: |
|
||||
# Get version from Chart.yaml
|
||||
CHART_VERSION=$(grep '^version:' helm/api7ee/Chart.yaml | awk '{print $2}')
|
||||
echo "Chart version: ${CHART_VERSION}"
|
||||
|
||||
# Update image registry and repository in values.yaml to match Gitea
|
||||
sed -i "s|registry: gitea.server_url|registry: ${{ gitea.server_url }}|g" helm/api7ee/values.yaml
|
||||
sed -i "s|repository: gitea.repository/|repository: ${{ gitea.repository }}/|g" helm/api7ee/values.yaml
|
||||
# Create a temporary copy of the chart for packaging
|
||||
cp -r helm/api7ee /tmp/api7ee-chart
|
||||
|
||||
# Package the chart
|
||||
helm package helm/api7ee/ --version ${CHART_VERSION}
|
||||
# Update image registry and repository in the copy's values.yaml
|
||||
sed -i "s|registry: gitea.server_url|registry: ${{ gitea.server_url }}|g" /tmp/api7ee-chart/values.yaml
|
||||
sed -i "s|repository: gitea.repository/|repository: ${{ gitea.repository }}/|g" /tmp/api7ee-chart/values.yaml
|
||||
|
||||
# Package the modified chart
|
||||
helm package /tmp/api7ee-chart --version ${CHART_VERSION}
|
||||
|
||||
# Store chart filename for later use
|
||||
echo "CHART_FILE=api7ee-${CHART_VERSION}.tgz" >> $GITHUB_ENV
|
||||
|
||||
Reference in New Issue
Block a user