generated from ansible-community/project-template
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Miles Wilson <[email protected]>
- Loading branch information
Showing
9 changed files
with
320 additions
and
250 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,51 @@ | ||
name: Release Chart | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Generate Chart | ||
run: | | ||
make helm-chart-generate | ||
- name: Check for changes to generated helm chart | ||
id: check_changes | ||
run: | | ||
git status --porcelain charts/ | grep -q "." && echo "changes=true" >> $GITHUB_OUTPUT || echo "changes=false" >> $GITHUB_OUTPUT | ||
# If we generated a new helm chart, we need to commit it | ||
# We need to do this step because our helm chart is not the source of truth, it's generated from starter | ||
# Note that failing to do this doesn't break this release, but it can break future ones and make the release state confusing | ||
- name: Commit generated chart | ||
id: update_source | ||
run: | | ||
git pull | ||
git add charts/ | ||
git commit -m "Generated chart for release" | ||
git push | ||
if: steps.check_changes.outputs.changes == 'true' | ||
|
||
# Chart releaser will internally only run if there is a diff in charts, | ||
# but we explicitly check to keep the chart releaser and our generates charts/ dir in sync | ||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
if: steps.check_changes.outputs.changes == 'true' |
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
Oops, something went wrong.