diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index dd88643b2..bfc5030b0 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -54,6 +54,23 @@ jobs: hdiutil detach /Volumes/VulkanSDK echo "VULKAN_SDK=$HOME/VulkanSDK/macOS" >> $GITHUB_ENV if: runner.os == 'macOS' + + - name: test semver + run: | + VERSION=$(git describe --tags --always --match "gdxsv-*" | sed -E "s/-([0-9]+)-g(.+)$/-dev.\\1+\\2/g") + echo $VERSION + # Check if the version is a dev version and increment the patch number + if [[ "$VERSION" =~ -dev\.([0-9]+) ]]; then + # Extract the current patch version + PATCH_VERSION="${BASH_REMATCH[1]}" + # Increment the patch version + PATCH_VERSION=$((PATCH_VERSION + 1)) + # Replace the old patch version with the new one + VERSION=$(echo "$VERSION" | sed -E "s/-dev\.[0-9]+/-dev.${PATCH_VERSION}/") + fi + echo $VERSION + + shell: bash - name: Set up build environment (Linux) run: |