Skip to content

Commit

Permalink
Add version pre-checks to helm workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sd109 committed Sep 2, 2024
1 parent 831501b commit 342c36a
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/helm-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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<upstream-semver>-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
Expand Down

0 comments on commit 342c36a

Please sign in to comment.