Skip to content

Commit

Permalink
Fix versioning of snapshots (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
yannick-roeder authored Jul 8, 2024
1 parent b12b059 commit 360327d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/helm-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
needs: get-version
Expand Down

0 comments on commit 360327d

Please sign in to comment.