From 59f40cb665be0f81dc7d38ef234fadeae93463d1 Mon Sep 17 00:00:00 2001 From: Luc Date: Tue, 17 Dec 2024 20:50:16 +0100 Subject: [PATCH] Update CI --- .github/workflows/build.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7141a21..a7baa42 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -54,16 +54,15 @@ jobs: # Otherwise use the version number in the engine/Cargo.toml and append it with -alpha - name: Update version number run: | - if [[ ${{ github.ref }} =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then - # Extract version number from tag (remove refs/tags/v prefix) + if [[ "${{ github.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then VERSION=${GITHUB_REF#refs/tags/v} echo "Release tag detected, using version: $VERSION" - # update the version in Cargo.toml sed -i "s/^version = .*/version = \"${VERSION}\"/" engine/Cargo.toml else echo "No release tag detected, using version from Cargo.toml" - version=$(grep -oP '(?<=version = ")[^"]+' engine/Cargo.toml) - # update the version in Cargo.toml + # parse version from Cargo.toml using regex + version=$(grep -oP 'version = "([^"]+)"' engine/Cargo.toml | sed 's/^version = "\(.*\)"$/\1/') + echo "Current version: $version" sed -i "s/^version = .*/version = \"${version}-alpha\"/" engine/Cargo.toml fi