@@ -33,15 +33,14 @@ jobs:
3333 run : |
3434 helm repo add ecovadis https://ecovadiscode.github.io/charts/
3535
36- - name : Isolate core chart for release
36+ - name : Remove all charts except core
3737 run : |
38- mkdir -p _core-release
39- cp -r charts/core _core-release/core
38+ find charts/ -mindepth 1 -maxdepth 1 -type d ! -name core -exec rm -rf {} +
4039
4140 - name : Run chart-releaser for core
4241 uses : helm/chart-releaser-action@v1.4.0
4342 with :
44- charts_dir : " _core-release "
43+ charts_dir : " charts "
4544 env :
4645 CR_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
4746
@@ -73,18 +72,23 @@ jobs:
7372
7473 - name : Wait for core chart availability in Helm repo
7574 run : |
76- CORE_VERSION=$(grep '^version:' charts/core/Chart.yaml | awk '{print $2}')
77- echo "Waiting for charts-core ${CORE_VERSION} to be available..."
75+ # Find the highest core version required by any dependent chart
76+ NEEDED_VERSION=$(grep -A2 'name: charts-core' charts/*/Chart.yaml | grep 'version:' | awk '{print $2}' | tr -d '"' | sort -V | tail -1)
77+ if [ -z "$NEEDED_VERSION" ]; then
78+ echo "No charts depend on charts-core, skipping wait."
79+ exit 0
80+ fi
81+ echo "Highest charts-core version needed by dependent charts: ${NEEDED_VERSION}"
7882 for i in $(seq 1 30); do
7983 helm repo update 2>/dev/null
80- if helm search repo ecovadis/charts-core --version "${CORE_VERSION }" | grep -q "${CORE_VERSION }"; then
81- echo "charts-core ${CORE_VERSION } is available!"
84+ if helm search repo ecovadis/charts-core --version "${NEEDED_VERSION }" | grep -q "${NEEDED_VERSION }"; then
85+ echo "charts-core ${NEEDED_VERSION } is available!"
8286 exit 0
8387 fi
8488 echo "Attempt ${i}/30 - not yet available, waiting 10s..."
8589 sleep 10
8690 done
87- echo "Timeout waiting for charts-core ${CORE_VERSION } after 5 minutes"
91+ echo "Timeout waiting for charts-core ${NEEDED_VERSION } after 5 minutes"
8892 exit 1
8993
9094 - name : Run chart-releaser for remaining charts
0 commit comments