From d38fd696c1018fd98fee94dab2613d36bf7586fd Mon Sep 17 00:00:00 2001 From: Marc Barry <4965634+marc-barry@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:34:10 -0500 Subject: [PATCH 1/5] Auto release updated charts. --- .github/workflows/release.yaml | 25 ++++++++++++++++++++++- README.md | 16 +++------------ bin/package | 7 ------- deploy.yaml | 36 ---------------------------------- 4 files changed, 27 insertions(+), 57 deletions(-) delete mode 100755 bin/package delete mode 100644 deploy.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 66922db..b48d6ad 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -13,7 +13,7 @@ jobs: uses: actions/checkout@v4 - name: Set up Helm - uses: azure/setup-helm@v3.5 + uses: azure/setup-helm@v4 - name: Identify Changed Charts id: changed_charts @@ -36,7 +36,30 @@ jobs: CHART_VERSION=$(grep 'version:' $CHART_PATH/Chart.yaml | cut -d ' ' -f 2) RELEASE_NAME="$chart-$CHART_VERSION" gh release create $RELEASE_NAME *.tgz --title "$RELEASE_NAME" --notes "New release of $chart" + + # Update the Helm repository index + helm repo index . --url https://github.com/qpoint-io/helm-charts/releases/download/$RELEASE_NAME --merge index.yaml + + # Add to commit message + echo "$RELEASE_NAME" >> changed_versions.txt fi done env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Commit Updated Index + if: env.CHANGED_CHARTS != '' + run: | + # Create commit message from changed versions + echo "Update Helm repository index with:" > commit_msg.txt + echo "" >> commit_msg.txt + cat changed_versions.txt >> commit_msg.txt + + # Configure Git + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + + # Commit and push changes + git add index.yaml + git commit -F commit_msg.txt + git push diff --git a/README.md b/README.md index 3aae524..9fd7c8c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # helm-charts -Qpoint Helm charts are available at https://helm.qpoint.io/. +Qpoint Helm charts are available at . ```sh helm repo add qpoint https://helm.qpoint.io/ @@ -15,7 +15,7 @@ helm search repo qpoint ## Releasing a new version -1. Create a PR that updates `Chart.yaml`'s version numbers. + 1. Create a PR that updates `Chart.yaml`'s version numbers. ```yaml # This is the chart version. This version number should be incremented each time you make changes @@ -30,14 +30,4 @@ version: 0.0.18 # 🚨 Update this version number appVersion: "v0.5.14" # 🚨 Update this version number ``` -2. Merge the PR. - -3. Pull the latest `main` branch and release the chart. - -4. Create a new branch for the next version. - -5. Run the `./bin/update-index` script to update the index.yaml file. - -6. Submit a PR with the updated index.yaml file and merge it. - -7. Done! 🎉 \ No newline at end of file + 2. Merge the PR and the index.yaml file will be updated automatically and deployed to the helm repo. diff --git a/bin/package b/bin/package deleted file mode 100755 index bb87e53..0000000 --- a/bin/package +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -set -eu - -for chart in charts/*; do - helm package "$chart" -d $chart/.packaged-charts -done diff --git a/deploy.yaml b/deploy.yaml deleted file mode 100644 index 2eaa615..0000000 --- a/deploy.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: echoserver -spec: - replicas: 1 - selector: - matchLabels: - app: echoserver - template: - metadata: - labels: - app: echoserver - spec: - containers: - - image: ealen/echo-server:latest - imagePullPolicy: IfNotPresent - name: echoserver - ports: - - containerPort: 80 - env: - - name: PORT - value: "80" ---- -apiVersion: v1 -kind: Service -metadata: - name: echoserver -spec: - ports: - - port: 80 - targetPort: 80 - protocol: TCP - type: ClusterIP - selector: - app: echoserver From b9b7ac63f8b04e03262aadcb718dd7139a657280 Mon Sep 17 00:00:00 2001 From: Marc Barry <4965634+marc-barry@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:36:41 -0500 Subject: [PATCH 2/5] Lint charts. --- .github/workflows/pr-validation.yaml | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/pr-validation.yaml diff --git a/.github/workflows/pr-validation.yaml b/.github/workflows/pr-validation.yaml new file mode 100644 index 0000000..0157aed --- /dev/null +++ b/.github/workflows/pr-validation.yaml @@ -0,0 +1,33 @@ +name: PR Validation + +on: + pull_request: + paths: + - 'charts/**' + +jobs: + lint-charts: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Helm + uses: azure/setup-helm@v4 + + - name: Identify Changed Charts + id: changed_charts + run: | + CHANGED_CHARTS=$(git diff --name-only origin/${{ github.base_ref }} --diff-filter=ACDMRT | grep '^charts/' | awk -F/ '{print $2}' | uniq | tr '\n' ' ') + echo "CHANGED_CHARTS=$CHANGED_CHARTS" >> $GITHUB_ENV + + - name: Lint Changed Charts + if: env.CHANGED_CHARTS != '' + run: | + for chart in $CHANGED_CHARTS; do + CHART_PATH="charts/$chart" + if [ -d "$CHART_PATH" ]; then + echo "Linting $chart..." + helm lint $CHART_PATH + fi + done From 386a5374989383854d9b21736aca912653c0e842 Mon Sep 17 00:00:00 2001 From: Marc Barry <4965634+marc-barry@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:45:36 -0500 Subject: [PATCH 3/5] Update to Qpoint v0.5.16. --- charts/qpoint-tap/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/qpoint-tap/Chart.yaml b/charts/qpoint-tap/Chart.yaml index 2acd20c..80577bf 100644 --- a/charts/qpoint-tap/Chart.yaml +++ b/charts/qpoint-tap/Chart.yaml @@ -8,10 +8,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.19 +version: 0.0.20 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v0.5.15" +appVersion: "v0.5.16" From 7eb7e5bd776479301b5861ccf2c3540e50aa2a79 Mon Sep 17 00:00:00 2001 From: Marc Barry <4965634+marc-barry@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:47:34 -0500 Subject: [PATCH 4/5] Fix checking for changed charts. --- .github/workflows/pr-validation.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pr-validation.yaml b/.github/workflows/pr-validation.yaml index 0157aed..e738305 100644 --- a/.github/workflows/pr-validation.yaml +++ b/.github/workflows/pr-validation.yaml @@ -11,6 +11,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for all branches - name: Set up Helm uses: azure/setup-helm@v4 @@ -18,6 +20,7 @@ jobs: - name: Identify Changed Charts id: changed_charts run: | + git fetch origin ${{ github.base_ref }} CHANGED_CHARTS=$(git diff --name-only origin/${{ github.base_ref }} --diff-filter=ACDMRT | grep '^charts/' | awk -F/ '{print $2}' | uniq | tr '\n' ' ') echo "CHANGED_CHARTS=$CHANGED_CHARTS" >> $GITHUB_ENV From f57b2bbf057e4326a2b5563700c7fc4073d78d87 Mon Sep 17 00:00:00 2001 From: Marc Barry <4965634+marc-barry@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:49:37 -0500 Subject: [PATCH 5/5] Output changed charts. --- .github/workflows/pr-validation.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr-validation.yaml b/.github/workflows/pr-validation.yaml index e738305..5b59a4f 100644 --- a/.github/workflows/pr-validation.yaml +++ b/.github/workflows/pr-validation.yaml @@ -22,6 +22,7 @@ jobs: run: | git fetch origin ${{ github.base_ref }} CHANGED_CHARTS=$(git diff --name-only origin/${{ github.base_ref }} --diff-filter=ACDMRT | grep '^charts/' | awk -F/ '{print $2}' | uniq | tr '\n' ' ') + echo "Changed charts detected: $CHANGED_CHARTS" echo "CHANGED_CHARTS=$CHANGED_CHARTS" >> $GITHUB_ENV - name: Lint Changed Charts