Skip to content

Commit debc301

Browse files
committed
ci: update versioning logic for OCM components
• Retrieve and increment patch version based on existing component version • Set default version to 0.0.0 if no version is found
1 parent 3cb5986 commit debc301

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

.github/workflows/ocm.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,11 @@ jobs:
7878
# echo OBSERVABILITY_VERSION=$(./ocm get componentversions --latest github.com/platform-mesh/observability --repo ghcr.io/platform-mesh -o json | jq -r '.items[0].component.version') >> $GITHUB_ENV
7979
echo VIRTUAL_WORKSPACES_VERSION=$(./ocm get componentversions --latest github.com/platform-mesh/virtual-workspaces --repo ghcr.io/platform-mesh -o json | jq -r '.items[0].component.version') >> $GITHUB_ENV
8080
81-
# PM_VERSION=$(./ocm get componentversions --latest github.com/platform-mesh/platform-mesh --repo ghcr.io/platform-mesh -o json | jq -r '.items[0].component.version')
82-
# PM_VERSION=${PM_VERSION:-0.0.0}
83-
84-
# IFS='.' read -r major minor patch <<< "PM_VERSION"
85-
# patch=$((patch + 1))
86-
# echo VERSION="$major.$minor.$patch" >> $GITHUB_ENV
87-
echo VERSION="0.0.1" >> $GITHUB_ENV
81+
PM_VERSION=$(./ocm get componentversions --latest github.com/platform-mesh/platform-mesh --repo ghcr.io/platform-mesh -o json | jq -r '.items[0].component.version')
82+
PM_VERSION=${PM_VERSION:-0.0.0}
83+
IFS='.' read -r major minor patch <<< "PM_VERSION"
84+
patch=$((patch + 1))
85+
echo VERSION="$major.$minor.$patch" >> $GITHUB_ENV
8886
8987
- name: create OCM ComponentArchive
9088
run: |

0 commit comments

Comments
 (0)