Skip to content

Commit

Permalink
chore: check that chart version has been bumped in PRs too
Browse files Browse the repository at this point in the history
  • Loading branch information
le0m committed Sep 4, 2024
1 parent 1d64a72 commit e37e42c
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,23 @@ jobs:
- name: Validate
run: helm kubeconform --summary -f .github/values.yml chart

version-bump:
name: Check version bump
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check version bump
run: |
version="$(grep 'version:' ./chart/Chart.yaml | tail -n1 | awk '{ print $2 }')"
! helm show chart oci://ghcr.io/chialab/helm-charts/print2pdf-go --version ${version} >/dev/null 2>&1 || (echo "Did you forget to increase Chart version?"; exit 1)
release-chart:
name: Package and release Helm chart
if: ${{ github.event_name != 'pull_request' }}
needs: [lint, validation]
needs: [lint, validation, version-bump]
runs-on: ubuntu-latest
timeout-minutes: 5

Expand All @@ -66,16 +79,11 @@ jobs:
- name: Setup Helm
uses: azure/setup-helm@v4

- name: Check version bump
id: check
run: |
version="$(grep 'version:' ./chart/Chart.yaml | tail -n1 | awk '{ print $2 }')"
! helm show chart oci://ghcr.io/chialab/helm-charts/print2pdf-go --version ${version} >/dev/null 2>&1 || (echo "Did you forget to bump Chart version?"; exit 1)
echo "version=${version}" >> "$GITHUB_OUTPUT"
- name: Package chart
run: helm package chart

- name: Publish chart
run: helm push "print2pdf-go-${{ steps.check.outputs.version }}.tgz" oci://ghcr.io/chialab/helm-charts
run: |
version="$(grep 'version:' ./chart/Chart.yaml | tail -n1 | awk '{ print $2 }')"
helm push "print2pdf-go-${version}.tgz" oci://ghcr.io/chialab/helm-charts

0 comments on commit e37e42c

Please sign in to comment.