Skip to content

Commit

Permalink
asd
Browse files Browse the repository at this point in the history
  • Loading branch information
stamepicmorg committed Sep 29, 2024
1 parent e8fec05 commit d2312bd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
10 changes: 8 additions & 2 deletions src/UpdateVersion.csx → UpdateVersion.csx
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
// This is META-file for using ins CI.
////////////////////////////////////////////////////////////
//
// This is META-file for using in CI system.
// STAM, EpicMorg
////////////////////////////////////////////////////////////

#r "nuget: System.Xml.ReaderWriter"

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}";

Expand Down

0 comments on commit d2312bd

Please sign in to comment.