Skip to content

Patch: Please refer to changelog for v1.2.1. Added IDS Endpoint, Dele… #37

Patch: Please refer to changelog for v1.2.1. Added IDS Endpoint, Dele…

Patch: Please refer to changelog for v1.2.1. Added IDS Endpoint, Dele… #37

name: Release charts
on:
push:
branches:
- master
paths:
- 'charts/**'
workflow_dispatch:
jobs:
bump-versions:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Bump cnrm-chart
uses: ./.github/actions/bumpVersionAction
with:
chart: cnrm-chart
- name: Push Results
id: pushResults
run: |
if git merge-base --is-ancestor HEAD @{u} ; then
echo "publish=false" >> $GITHUB_OUTPUT
echo "No push necessary"
else
echo "Version bumps happened. Pushing now..."
git push
echo "publish=true" >> $GITHUB_OUTPUT
fi
outputs:
publish: ${{ steps.pushResults.outputs.publish }}
delete-old-releases:
runs-on: ubuntu-latest
needs:
- bump-versions
if: needs.bump-versions.outputs.publish == 'true'
steps:
- name: Delete Older Releases
uses: dev-drprasad/delete-older-releases@v0.2.1
with:
keep_latest: 3
delete_tags: true
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
chart-releaser:
runs-on: ubuntu-latest
needs:
- bump-versions
- delete-old-releases
if: needs.bump-versions.outputs.publish == 'true'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
git pull
- name: Install Helm
uses: azure/setup-helm@v3
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.5.0
with:
charts_dir: charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_RELEASE_NOTES_FILE: "CHANGELOG.md"