diff --git a/.github/workflows/pr-validation.yaml b/.github/workflows/pr-validation.yaml new file mode 100644 index 0000000..5b59a4f --- /dev/null +++ b/.github/workflows/pr-validation.yaml @@ -0,0 +1,37 @@ +name: PR Validation + +on: + pull_request: + paths: + - 'charts/**' + +jobs: + lint-charts: + runs-on: ubuntu-latest + 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 + + - 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 detected: $CHANGED_CHARTS" + 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 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/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" 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