diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 2d65531..6fb0879 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -13,9 +13,10 @@ defaults: jobs: build: runs-on: windows-latest - defaults: - run: - working-directory: src + env: + DOTNET_NOLOGO: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true strategy: matrix: @@ -31,20 +32,18 @@ jobs: # with: # dotnet-version: 8.x - - name: Restore dependencies - run: dotnet restore +# - name: Restore dependencies +# run: dotnet restore - - name: Check current directory and files - run: | - echo "Current Directory: $(pwd)" - echo "Files in current directory:" - ls -Recurse + - name: Install dotnet-script + run: dotnet tool install --global dotnet-script shell: pwsh - - name: Update version - run: dotnet script $(GITHUB_WORKSPACE)/src/UpdateVersion.csx + - name: Update version in project + run: dotnet script "${{ github.workspace }}/UpdateVersion.csx" env: GITHUB_RUN_NUMBER: ${{ github.run_number }} + shell: pwsh - name: Build run: dotnet build --configuration ${{ matrix.configuration }} --verbosity minimal diff --git a/src/UpdateVersion.csx b/UpdateVersion.csx similarity index 66% rename from src/UpdateVersion.csx rename to UpdateVersion.csx index 9ca62ac..17e3f67 100644 --- a/src/UpdateVersion.csx +++ b/UpdateVersion.csx @@ -1,4 +1,8 @@ -// This is META-file for using ins CI. +//////////////////////////////////////////////////////////// +// +// This is META-file for using in CI system. +// STAM, EpicMorg +//////////////////////////////////////////////////////////// #r "nuget: System.Xml.ReaderWriter" @@ -6,13 +10,15 @@ using System; using System.IO; using System.Xml; -var versionFilePath = "src/kasthack.binding.wf.csproj"; +var versionFilePath = "kasthack.binding.wf.csproj"; var xmlDoc = new XmlDocument(); xmlDoc.Load(versionFilePath); var versionNode = xmlDoc.SelectSingleNode("//Version"); var currentVersion = versionNode.InnerText; +Console.WriteLine($"Current version is: {currentVersion}"); + var buildNumber = Environment.GetEnvironmentVariable("GITHUB_RUN_NUMBER"); var newVersion = $"{currentVersion.Split('.')[0]}.{currentVersion.Split('.')[1]}.{buildNumber}";