Skip to content

Commit

Permalink
Merge pull request #142 from qpoint-io/marc-barry/auto-deploy
Browse files Browse the repository at this point in the history
Auto release updated charts and update to Qpoint v0.5.16.
  • Loading branch information
marc-barry authored Dec 6, 2024
2 parents 9a21d0d + f57b2bb commit 60064b2
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 59 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/pr-validation.yaml
Original file line number Diff line number Diff line change
@@ -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
25 changes: 24 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# helm-charts

Qpoint Helm charts are available at https://helm.qpoint.io/.
Qpoint Helm charts are available at <https://helm.qpoint.io/>.

```sh
helm repo add qpoint https://helm.qpoint.io/
Expand All @@ -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
Expand All @@ -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! 🎉
2. Merge the PR and the index.yaml file will be updated automatically and deployed to the helm repo.
7 changes: 0 additions & 7 deletions bin/package

This file was deleted.

4 changes: 2 additions & 2 deletions charts/qpoint-tap/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
36 changes: 0 additions & 36 deletions deploy.yaml

This file was deleted.

0 comments on commit 60064b2

Please sign in to comment.