From 342c36a9b6d956e6885993db34c707fa6b070403 Mon Sep 17 00:00:00 2001 From: sd109 Date: Mon, 2 Sep 2024 19:46:01 +0100 Subject: [PATCH] Add version pre-checks to helm workflow --- .github/workflows/helm-build-push.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/helm-build-push.yml b/.github/workflows/helm-build-push.yml index 499025a7fc1..5b4ece5308c 100644 --- a/.github/workflows/helm-build-push.yml +++ b/.github/workflows/helm-build-push.yml @@ -19,15 +19,21 @@ jobs: with: fetch-depth: 0 - # We publish our 'release' Semver tags as X.Y.Z-stackhpc.[1-9]+ - # so if main branch chart version doesn't match this then abort - - name: Fail on dev chart version - run: yq .version deployment/helm/Chart.yaml | grep "\-stackhpc.[0-9]\+$" + - name: Fail on semver pre-release chart version + run: yq .version deployment/helm/Chart.yaml | grep -v '[a-zA-Z-]' if: ${{ github.ref_name == 'main'}} - # Stable 'release' image tags should be of the form "v-stackhpc.X" - - name: Fail on dev image version - run: yq .appVersion deployment/helm/Chart.yaml | grep "^v[0-9]" | grep "\-stackhpc.[0-9]\+$" + - name: Fail if image tags don't exist + run: >- + curl -H "Authorization: Bearer $(echo ${{ secrets.GITHUB_TOKEN }} | base64)" + https://ghcr.io/v2/stackhpc/danswer/danswer-backend/tags/list + | jq .tags + | grep $( yq .appVersion deployment/helm/Chart.yaml )-$( yq .tagSuffix deployment/helm/values.yaml ) + && + curl -H "Authorization: Bearer $(echo ${{ secrets.GITHUB_TOKEN }} | base64)" + https://ghcr.io/v2/stackhpc/danswer/danswer-web-server/tags/list + | jq .tags + | grep $( yq .appVersion deployment/helm/Chart.yaml )-$( yq .tagSuffix deployment/helm/values.yaml ) if: ${{ github.ref_name == 'main'}} - name: Configure Git