From 339073e494f6d5611aa4c1dbaa52b50cf30d3d31 Mon Sep 17 00:00:00 2001 From: jefim Date: Mon, 30 Jun 2025 12:48:20 +0300 Subject: [PATCH] Refactor GitHub CI to extract version from project file --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7b20e59..844f939 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: - name: Get version from project id: get_version run: | - VERSION=$(dotnet run --project Frends.Web -- --version 2>/dev/null || echo "1.0.0") + VERSION=$(grep -oP '\K[^<]+' Frends.Web/Frends.Web.csproj) echo "version=$VERSION" >> $GITHUB_OUTPUT - name: Pack NuGet package diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f4bdef7..173cff7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,4 +29,10 @@ jobs: run: dotnet build --no-restore - name: Test - run: dotnet test --no-build --verbosity normal --framework net6.0 \ No newline at end of file + run: dotnet test --no-build --verbosity normal --framework net6.0 + + - name: Get version from project + id: get_version + run: | + VERSION=$(grep -oP '\K[^<]+' Frends.Web/Frends.Web.csproj) + echo "Version detected: $VERSION" \ No newline at end of file