1 Star 0 Fork 4K

老赵 / Furion

forked from dotNET China / Furion 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
nuget-push.ps1 1.35 KB
一键复制 编辑 Web IDE 原始数据 按行查看 历史
# 排除 Furion 和 Furion.Pure 发布,原因是这两个包依赖了 Furion.[Pure].Extras.DependencyModel.CodeAnalysis 拓展包
#
# 定义参数
Param(
# 版本号
[string] $version,
# Nuget APIKey
[string] $apikey
)
if ($version -eq $null -or $version -eq "")
{
Write-Error "必须指定版本号";
return;
}
Write-Warning "正在发布 framework 目录 Nuget 包......";
# 查找 .\framework\nupkgs 下所有目录
cd .\framework\nupkgs;
$framework_nupkgs = Get-ChildItem -Filter *.nupkg;
# 遍历所有 *.nupkg 文件
for ($i = 0; $i -le $framework_nupkgs.Length - 1; $i++){
$item = $framework_nupkgs[$i];
# 排除 Furion 和 Furion.Pure 发布,原因是这两个包依赖了 Furion.[Pure].Extras.DependencyModel.CodeAnalysis 拓展包
if ($item.Name -ne "Furion.$version.nupkg" -and $item.Name -ne "Furion.Pure.$version.nupkg")
{
$nupkg = $item.FullName;
$snupkg = $nupkg.Replace(".nupkg", ".snupkg");
Write-Output "-----------------";
$nupkg;
# 发布到 nuget.org 平台
dotnet nuget push $nupkg --api-key $apikey --source https://api.nuget.org/v3/index.json;
dotnet nuget push $snupkg --api-key $apikey --source https://api.nuget.org/v3/index.json;
Write-Output "-----------------";
}
}
# 回到项目根目录
cd ../../;
Write-Warning "发布成功";
C#
1
https://gitee.com/xiaopohou/Furion.git
git@gitee.com:xiaopohou/Furion.git
xiaopohou
Furion
Furion
net6

搜索帮助

14c37bed 8189591 565d56ea 8189591