Skip to content

Commit

Permalink
feat: Add version in csharp packages (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
lemaitre-aneo authored Dec 21, 2023
2 parents e899200 + 1488d6a commit b7dbb58
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<DebugType>Embedded</DebugType>
<IncludeSymbols>true</IncludeSymbols>
<PackageVersion>3.14.0</PackageVersion>
<Version>3.14.0</Version>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<AssemblyOriginatorKeyFile>../kp.snk</AssemblyOriginatorKeyFile>
<Optimize>true</Optimize>
<PackageVersion>3.14.0</PackageVersion>
<Version>3.14.0</Version>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageVersion>3.14.0</PackageVersion>
<Version>3.14.0</Version>
<PackageOutputPath>../publish</PackageOutputPath>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<AssemblyOriginatorKeyFile>../kp.snk</AssemblyOriginatorKeyFile>
<Optimize>true</Optimize>
<PackageVersion>3.14.0</PackageVersion>
<Version>3.14.0</Version>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions packages/csharp/ArmoniK.Api.Core/ArmoniK.Api.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<AssemblyOriginatorKeyFile>../kp.snk</AssemblyOriginatorKeyFile>
<PackageVersion>3.14.0</PackageVersion>
<Version>3.14.0</Version>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
Expand Down
1 change: 1 addition & 0 deletions packages/csharp/ArmoniK.Api.Mock/ArmoniK.Api.Mock.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<AssemblyOriginatorKeyFile>../kp.snk</AssemblyOriginatorKeyFile>
<PackageVersion>3.14.0</PackageVersion>
<Version>3.14.0</Version>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<DebugType>Embedded</DebugType>
<IncludeSymbols>true</IncludeSymbols>
<PackageVersion>3.14.0</PackageVersion>
<Version>3.14.0</Version>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<AssemblyOriginatorKeyFile>../kp.snk</AssemblyOriginatorKeyFile>
<PackageVersion>3.14.0</PackageVersion>
<Version>3.14.0</Version>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
Expand Down
11 changes: 8 additions & 3 deletions scripts/update-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
cppFiles,
cppPattern,
csharpFiles,
csharpPattern,
csharpPatternPackageVersion,
csharpPatternVersion,
jsFiles,
jsPattern,
} from './versions/_contants'
Expand All @@ -21,9 +22,13 @@ if (args.length === 0) {

const version = args[0]

consola.info('Updating C# projects to ', version)
consola.info('Updating C# <PackageVersion> projects to ', version)
csharpFiles.forEach(
_readAndReplace(csharpPattern, `<PackageVersion>${version}</PackageVersion>`),
_readAndReplace(csharpPatternPackageVersion, `<PackageVersion>${version}</PackageVersion>`),
)
consola.info('Updating C# <Version> projects to ', version)
csharpFiles.forEach(
_readAndReplace(csharpPatternVersion, `<Version>${version}</Version>`),
)

consola.info('Updating JS projects to ', version)
Expand Down
9 changes: 6 additions & 3 deletions scripts/verify-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import {
cppFiles,
cppPattern,
csharpFiles,
csharpPattern,
csharpPatternPackageVersion,
csharpPatternVersion,
jsFiles,
jsPattern,
} from './versions/_contants'
Expand All @@ -15,8 +16,10 @@ const [, , ...args] = process.argv

consola.info('Finding JS projects versions')
jsFiles.forEach(_readAndFind(jsPattern, versions))
consola.info('Finding C# projects versions')
csharpFiles.forEach(_readAndFind(csharpPattern, versions))
consola.info('Finding C# <PackageVersion> projects versions')
csharpFiles.forEach(_readAndFind(csharpPatternPackageVersion, versions))
consola.info('Finding C# <Version> projects versions')
csharpFiles.forEach(_readAndFind(csharpPatternVersion, versions))
consola.info('Finding Cpp projects versions')
cppFiles.forEach(_readAndFind(cppPattern, versions))

Expand Down
3 changes: 2 additions & 1 deletion scripts/versions/_contants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { glob } from 'glob'

export const csharpPattern = /<PackageVersion>(?<version>.*)<\/PackageVersion>/
export const csharpPatternPackageVersion = /<PackageVersion>(?<version>.*)<\/PackageVersion>/
export const csharpPatternVersion = /<Version>(?<version>.*)<\/Version>/
export const csharpFiles = glob.globSync('**/*.csproj')

export const pythonPattern = /version = "(?<version>.*)"/g
Expand Down

0 comments on commit b7dbb58

Please sign in to comment.