From 345b23f8015ba2e7dbe41fdf75bff6046ec7f743 Mon Sep 17 00:00:00 2001 From: Alan Rynne Date: Mon, 6 Mar 2023 10:53:02 +0100 Subject: [PATCH] feat(ci): Add Assembly version to published dlls (#22) --- .circleci/config.yml | 10 +++++++--- .../GrasshopperAsyncComponent.csproj | 7 ++++++- .../GrasshopperAsyncComponent.nuspec | 1 - .../Properties/AssemblyInfo.cs | 13 +++++++------ 4 files changed, 20 insertions(+), 11 deletions(-) mode change 100755 => 100644 GrasshopperAsyncComponent/Properties/AssemblyInfo.cs diff --git a/.circleci/config.yml b/.circleci/config.yml index 1feb211..400a6c0 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,12 +8,18 @@ jobs: executor: win/default steps: - checkout + - run: + name: Set version env var + command: | + $semver = if([string]::IsNullOrEmpty($env:CIRCLE_TAG)) { "0.0.999" } else { $env:CIRCLE_TAG } + $ver = if($semver.Contains('-')) {$semver.Split("-")[0] } else { $semver } + $version = "$($ver).$($env:WORKFLOW_NUM)" - run: name: Restore packages command: nuget restore GrasshopperAsyncComponent.sln - run: name: Build solution - command: msbuild GrasshopperAsyncComponent.sln /p:Configuration=Release + command: msbuild GrasshopperAsyncComponent.sln /p:Configuration=Release /p:AssemblyVersionNumber=$version /p:AssemblyInformationalVersion=$semver /p:Version=$semver - run: name: Pack NuGet command: cd GrasshopperAsyncComponent; nuget pack GrasshopperAsyncComponent.csproj -Prop Configuration=Release -Symbols -SymbolPackageFormat snupkg @@ -21,7 +27,6 @@ jobs: name: Push NuGet command: cd GrasshopperAsyncComponent; nuget push *.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey $env:NUGET_APIKEY -SkipDuplicate - workflows: publish: jobs: @@ -32,4 +37,3 @@ workflows: branches: ignore: /.*/ context: nuget - diff --git a/GrasshopperAsyncComponent/GrasshopperAsyncComponent.csproj b/GrasshopperAsyncComponent/GrasshopperAsyncComponent.csproj index d768eff..9b0407f 100755 --- a/GrasshopperAsyncComponent/GrasshopperAsyncComponent.csproj +++ b/GrasshopperAsyncComponent/GrasshopperAsyncComponent.csproj @@ -1,4 +1,4 @@ - + @@ -56,6 +56,11 @@ 6.28.20199.17141 compile; build; native; contentfiles; analyzers; buildtransitive + + 1.3.0 + runtime; build; native; contentfiles; analyzers; buildtransitive + all +