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:
|
with:
|
||||||
version: "latest"
|
version: "latest"
|
||||||
|
|
||||||
- name: Update Chart dependencies
|
|
||||||
run: |
|
|
||||||
cd helm/api7ee
|
|
||||||
helm dependency update
|
|
||||||
|
|
||||||
- name: Lint Helm chart
|
- name: Lint Helm chart
|
||||||
run: |
|
run: |
|
||||||
helm lint helm/api7ee/
|
helm lint helm/api7ee/
|
||||||
@@ -108,13 +103,17 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
# Get version from Chart.yaml
|
# Get version from Chart.yaml
|
||||||
CHART_VERSION=$(grep '^version:' helm/api7ee/Chart.yaml | awk '{print $2}')
|
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
|
# Create a temporary copy of the chart for packaging
|
||||||
sed -i "s|registry: gitea.server_url|registry: ${{ gitea.server_url }}|g" helm/api7ee/values.yaml
|
cp -r helm/api7ee /tmp/api7ee-chart
|
||||||
sed -i "s|repository: gitea.repository/|repository: ${{ gitea.repository }}/|g" helm/api7ee/values.yaml
|
|
||||||
|
|
||||||
# Package the chart
|
# Update image registry and repository in the copy's values.yaml
|
||||||
helm package helm/api7ee/ --version ${CHART_VERSION}
|
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
|
# Store chart filename for later use
|
||||||
echo "CHART_FILE=api7ee-${CHART_VERSION}.tgz" >> $GITHUB_ENV
|
echo "CHART_FILE=api7ee-${CHART_VERSION}.tgz" >> $GITHUB_ENV
|
||||||
|
|||||||
Reference in New Issue
Block a user