diff --git a/.github/workflows/helm-publish.yaml b/.github/workflows/helm-publish.yaml index d273d28..e2b3a2a 100644 --- a/.github/workflows/helm-publish.yaml +++ b/.github/workflows/helm-publish.yaml @@ -12,17 +12,25 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + + - name: Set up bump2version + run: | + pipx install bump2version + shell: bash + - name: Get current version from bumpversion id: get-version run: | - version=$(sed -nE 's/.*current_version = (.*)/\1/p' < .bumpversion.cfg) - if ! [[ "$GITHUB_REF" =~ ^refs/tags/.* ]]; then - version="${version}-SNAPSHOT" + if [[ "$GITHUB_REF" =~ ^refs/tags/.* ]]; then + version="$(sed -nE 's/.*current_version = (.*)/\1/p' < .bumpversion.cfg)" + else + bump2version --allow-dirty --no-tag --no-commit patch + version="$(sed -nE 's/.*current_version = (.*)/\1/p' < .bumpversion.cfg)-SNAPSHOT" fi echo "version=$version" >> $GITHUB_OUTPUT shell: bash - call-workflow-passing-data: + publish: name: Publish Helm chart uses: bakdata/ci-templates/.github/workflows/helm-multi-release.yaml@1.46.4 needs: get-version