Skip to content

Commit

Permalink
Update templates version
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Sep 16, 2024
1 parent a2d6c79 commit a9da659
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ publish()
global_packages=${global_packages/global-packages: /""}
run_command rm "-rf" "$global_packages/zeroc.slice/$version" "$global_packages/icerpc/$version" "$global_packages"/icerpc.*/"$version"
run_command dotnet "nuget" "push" "tools/**/$dotnet_config/*.$version*.nupkg" "--source" "$global_packages"
run_command dotnet "nuget" "push" "src/**/$dotnet_config/*.$version.nupkg" "--source" "$global_packages"
run_command dotnet "nuget" "push" "src/**/$dotnet_config/*.$version*.nupkg" "--source" "$global_packages"
}

code_coverage()
Expand Down
1 change: 1 addition & 0 deletions build/IceRpc.Version.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<Version Condition="'$(Version)' == ''">0.4.0</Version>
<IceRpcProtobufToolsVersion>0.4.0.1</IceRpcProtobufToolsVersion>
<IceRpcSliceToolsVersion>0.4.0.1</IceRpcSliceToolsVersion>
<IceRpcTemplatesVersion>0.4.0.1</IceRpcTemplatesVersion>
<!-- The Protobuf version used by IceRpc.Protobuf -->
<ProtobufVersion>28.1</ProtobufVersion>
<NuGetProtobufVersion>3.$(ProtobufVersion)</NuGetProtobufVersion>
Expand Down
23 changes: 15 additions & 8 deletions build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,22 @@ function Publish($config) {
$global_packages = dotnet nuget locals -l global-packages
$global_packages = $global_packages.replace("global-packages: ", "")
Remove-Item $global_packages"\IceRpc.Slice.Tools\$version" -Recurse -Force -ErrorAction Ignore
$packages = Get-Childitem -Path "." -Include *.$version.nupkg -Recurse
foreach ($package in $packages)
{
$package_name = (Get-Item $package).Basename
$package_name = $package_name.Substring(0, $package_name.Length - ".$version".Length)
Remove-Item $global_packages"\$package_name\$version" -Recurse -Force -ErrorAction Ignore
$packages = Get-ChildItem -Path "." -Include "*.$version*.nupkg" -Recurse
foreach ($package in $packages) {
$package_name = (Get-Item $package).BaseName
# Use a regex pattern to match the package name and version
$regex = "^(.*)\.($version[\d\.]*)$"
$match = [regex]::Match($package_name, $regex)

if ($match.Success) {
$package_name = $match.Groups[1].Value
$pkg_version = $match.Groups[2].Value
# Remove the item matching the package name and version
Remove-Item "$global_packages\$package_name\$pkg_version" -Recurse -Force -ErrorAction Ignore
}
}
RunCommand "dotnet" @('nuget', 'push', "tools\**\$dotnetConfiguration\*.$version.nupkg", '--source', $global_packages)
RunCommand "dotnet" @('nuget', 'push', "src\**\$dotnetConfiguration\*.$version.nupkg", '--source', $global_packages)
RunCommand "dotnet" @('nuget', 'push', "tools\**\$dotnetConfiguration\*.$version*.nupkg", '--source', $global_packages)
RunCommand "dotnet" @('nuget', 'push', "src\**\$dotnetConfiguration\*.$version*.nupkg", '--source', $global_packages)
}

function RunCommand($command, $arguments) {
Expand Down
1 change: 1 addition & 0 deletions src/IceRpc.Templates/IceRpc.Templates.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<PackageType>Template</PackageType>
<TargetFramework>net8.0</TargetFramework>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Version>$(IceRpcTemplatesVersion)</Version>
</PropertyGroup>
<ItemGroup>
<Content Include="Templates/**/*" Exclude="Templates/**/bin/**;Templates/**/obj/**">
Expand Down

0 comments on commit a9da659

Please sign in to comment.