Skip to content

Once again fixing version and more logging in gh action #42

Once again fixing version and more logging in gh action

Once again fixing version and more logging in gh action #42

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: Bump gateway-api-chart
uses: ./.github/actions/bumpVersionAction
with:
chart: gateway-api-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 }}
chart-releaser:
runs-on: ubuntu-latest
needs:
- bump-versions
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.6.0
with:
charts_dir: charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_RELEASE_NOTES_FILE: "CHANGELOG.md"