-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI and PR template improvements (#26)
* add Helm version check * add ci to ensure chart version bump when appVersion is bumped * add pull request template * CI check to ensure chart changelog is updated when changes are made * clean up chart changelog
- Loading branch information
Showing
4 changed files
with
114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## Proposed changes | ||
<!-- | ||
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue. | ||
--> | ||
|
||
## Types of changes | ||
|
||
What types of changes does your code introduce to the Deepgram self-hosted resources? | ||
_Put an `x` in the boxes that apply_ | ||
|
||
- [ ] Bugfix (non-breaking change which fixes an issue) | ||
- [ ] New feature (non-breaking change which adds functionality) | ||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) | ||
- [ ] Documentation update or tests (if none of the other choices apply) | ||
|
||
## Checklist | ||
|
||
_Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code._ | ||
|
||
- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) doc | ||
- [ ] I have tested my changes in my local self-hosted environment | ||
- Please describe your testing setup and methodology here | ||
- [ ] I have added necessary documentation (if appropriate) | ||
|
||
## Further comments | ||
|
||
<!-- | ||
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc... | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,25 +17,64 @@ jobs: | |
fetch-depth: 0 | ||
token: "${{ secrets.GH_SELFHOSTEDRESOURCES_RW }}" | ||
|
||
# `chart-releaser-action` only performs a `git diff` on Chart files. If we have a workflow where we want to | ||
# merge something without bumping the Chart version yet to create a release, the chart-releaser-action will | ||
# fail, since git detects that changes have been made, but the Chart version wasn't bumped. We don't want an | ||
# erroneous failure in this case, as that dev workflow is intentional. So this step detects if the Helm chart | ||
# version was bumped, and only continues if it was. | ||
# | ||
# This relies on PRs being squashed when merged (as it compares the head commit to its parent). | ||
# This is currently enforced in the repositories PR settings. | ||
- name: Check if Chart version was bumped | ||
id: check-chart-version | ||
run: | | ||
CHART_DIR="charts/deepgram-self-hosted" | ||
if git diff --name-only HEAD^..HEAD | grep "^$CHART_DIR"; then | ||
if [ ! -f "$CHART_DIR/Chart.yaml" ]; then | ||
echo "Error: Chart.yaml not found in $CHART_DIR" | ||
EXIT_CODE=1 | ||
continue | ||
fi | ||
OLD_VERSION=$(git show HEAD^:$CHART_DIR/Chart.yaml | grep '^version:' | awk '{print $2}') | ||
NEW_VERSION=$(grep '^version:' $CHART_DIR/Chart.yaml | awk '{print $2}') | ||
if [ "$OLD_VERSION" = "$NEW_VERSION" ]; then | ||
echo "$CHART_DIR has been changed, but version has not been bumped, so not performing release." | ||
echo "IS_CHART_VERSION_BUMPED=false" >> $GITHUB_OUTPUT | ||
else | ||
echo "$CHART_DIR has been updated, and version has been bumped from $OLD_VERSION to $NEW_VERSION." | ||
echo "Proceeding with release..." | ||
echo "IS_CHART_VERSION_BUMPED=true" >> $GITHUB_OUTPUT | ||
fi | ||
else | ||
echo "deepgram-self-hosted chart was not modified." | ||
echo "IS_CHART_VERSION_BUMPED=false" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Configure Git | ||
if: steps.check-chart-version.outputs.IS_CHART_VERSION_BUMPED == 'true' | ||
run: | | ||
# Give CI a git identity for its commit message | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Deepgram CI" | ||
- name: Install Helm | ||
if: steps.check-chart-version.outputs.IS_CHART_VERSION_BUMPED == 'true' | ||
uses: azure/setup-helm@v4 | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GH_SELFHOSTEDRESOURCES_RW }}" | ||
|
||
- name: Add Helm chart repositories for chart dependencies | ||
if: steps.check-chart-version.outputs.IS_CHART_VERSION_BUMPED == 'true' | ||
run: | | ||
helm repo add nvidia https://helm.ngc.nvidia.com/nvidia | ||
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts | ||
helm repo add autoscaler https://kubernetes.github.io/autoscaler | ||
helm repo update | ||
- name: Run chart-releaser | ||
if: steps.check-chart-version.outputs.IS_CHART_VERSION_BUMPED == 'true' | ||
uses: helm/[email protected] | ||
env: | ||
CR_TOKEN: "${{ secrets.GH_SELFHOSTEDRESOURCES_RW }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters