Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
29905b3d
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
29905b3d
编写于
3月 01, 2018
作者:
J
Jonathon Marolf
提交者:
GitHub
3月 01, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #25177 from dotnet/revert-25172-fix-publishing
Revert "disable nuget publishing"
上级
0076b1af
e234974d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
23 deletion
+23
-23
src/Tools/MicroBuild/publish-assets.ps1
src/Tools/MicroBuild/publish-assets.ps1
+23
-23
未找到文件。
src/Tools/MicroBuild/publish-assets.ps1
浏览文件 @
29905b3d
# Publishes our build assets to nuget, myget, dotnet/versions, etc ..
#
# The publish operation is best visioned as an optional yet repeatable post build operation. It can be
# run anytime after build or automatically as a post build step. But it is an operation that focuses on
# The publish operation is best visioned as an optional yet repeatable post build operation. It can be
# run anytime after build or automatically as a post build step. But it is an operation that focuses on
# build outputs and hence can't rely on source code from the build being available
#
# Repeatable is important here because we have to assume that publishes can and will fail with some
# degree of regularity.
# Repeatable is important here because we have to assume that publishes can and will fail with some
# degree of regularity.
[
CmdletBinding
(
PositionalBinding
=
$false
)]
Param
(
# Standard options
...
...
@@ -14,7 +14,7 @@ Param(
[
string
]
$releaseName
=
""
,
[
switch
]
$test
,
# Credentials
# Credentials
[
string
]
$gitHubUserName
=
""
,
[
string
]
$gitHubToken
=
""
,
[
string
]
$gitHubEmail
=
""
,
...
...
@@ -48,10 +48,10 @@ function Publish-NuGet([string]$packageDir, [string]$uploadUrl) {
}
if (-not
$test
) {
#
Exec-Console
$dotnet
"
nuget
push
$nupkg
--source
$uploadUrl
--apiKey
$apiKey
-v
q
"
Exec-Console
$dotnet
"
nuget
push
$nupkg
--source
$uploadUrl
--apiKey
$apiKey
-v
q
"
}
}
}
}
finally {
Pop-Location
}
...
...
@@ -59,7 +59,7 @@ function Publish-NuGet([string]$packageDir, [string]$uploadUrl) {
function Publish-Vsix([string]
$uploadUrl
) {
Push-Location
$configDir
try {
try {
Write-Host "
Publishing
VSIX
to
$uploadUrl
"
$apiKey
= Get-PublishKey
$uploadUrl
$extensions
= [xml](Get-Content (Join-Path
$configDir
"
myget_org-extensions.config
"))
...
...
@@ -70,7 +70,7 @@ function Publish-Vsix([string]$uploadUrl) {
}
Write-Host "
Publishing
'$vsix'
"
if (-not
$test
) {
if (-not
$test
) {
$response
= Invoke-WebRequest -Uri
$uploadUrl
-Headers @{"
X-NuGet-ApiKey
"=
$apiKey
} -ContentType 'multipart/form-data' -InFile
$vsix
-Method Post -UseBasicParsing
if (
$response
.StatusCode -ne 201) {
throw "
Failed
to
upload
VSIX
extension:
$vsix
.
Upload
failed
with
Status
code:
$response
.
StatusCode
"
...
...
@@ -87,15 +87,15 @@ function Publish-Channel([string]$packageDir, [string]$name) {
$publish
= Join-Path
$configDir
"
Exes\RoslynPublish\RoslynPublish.exe
"
$args
= "
-nugetDir
$packageDir
-channel
$name
-gu
$gitHubUserName
-gt
$gitHubToken
-ge
$githubEmail
"
Write-Host "
Publishing
$packageDir
to
channel
$name
"
if (-not
$test
) {
if (-not
$test
) {
Exec-Console
$publish
$args
}
}
# Do basic verification on the values provided in the publish configuration
function Test-Entry(
$publishData
, [switch]
$isBranch
) {
if (
$isBranch
) {
if (
$publishData
.nuget -ne
$null
) {
function Test-Entry(
$publishData
, [switch]
$isBranch
) {
if (
$isBranch
) {
if (
$publishData
.nuget -ne
$null
) {
$kind
=
$publishData
.nugetKind;
if (
$kind
-ne "
PerBuildPreRelease
") {
throw "
Branches
are
only
allowed
to
publish
PerBuildPreRelease
"
...
...
@@ -104,20 +104,20 @@ function Test-Entry($publishData, [switch]$isBranch) {
}
}
# Publish a given entry: branch or release.
function Publish-Entry(
$publishData
, [switch]
$isBranch
) {
# Publish a given entry: branch or release.
function Publish-Entry(
$publishData
, [switch]
$isBranch
) {
Test-Entry
$publishData
-isBranch:
$isBranch
$packageDir
= Join-Path
$nugetDir
$publishData
.nugetKind
# First publish the NuGet packages to the specified feeds
foreach (
$url
in
$publishData
.nuget) {
foreach (
$url
in
$publishData
.nuget) {
Publish-NuGet
$packageDir
$url
}
# Next publish the VSIX to the specified feeds
$vsixData
=
$publishData
.vsix
if (
$vsixData
-ne
$null
) {
if (
$vsixData
-ne
$null
) {
Publish-Vsix
$vsixData
}
...
...
@@ -129,8 +129,8 @@ function Publish-Entry($publishData, [switch]$isBranch) {
exit 0
}
function Test-Member(
$obj
, [string]
$name
) {
$value
= Get-Member -Name
$name
-InputObject
$obj
function Test-Member(
$obj
, [string]
$name
) {
$value
= Get-Member -Name
$name
-InputObject
$obj
return
$value
-ne
$null
}
...
...
@@ -138,7 +138,7 @@ function Test-Member($obj, [string]$name) {
# of our publish operations specify fully branch names like /refs/heads/master. Normalizing
# those out to the short branch name here.
function Normalize-BranchName([string]
$branchName
) {
switch -regex (
$branchName
) {
switch -regex (
$branchName
) {
"
refs/heads/
(
.*
)
"
{
return
$matches
[
1
]
}
"refs/pull/\d*/(.*)"
{
return
$matches
[
1
]
}
default
{
return
$branchName
}
...
...
@@ -165,15 +165,15 @@ try {
}
elseif
(
$branchName
-ne
""
)
{
$branchName
=
Normalize-BranchName
$branchName
if
(
-not
(
Test-Member
$data
.
branches
$branchName
))
{
if
(
-not
(
Test-Member
$data
.
branches
$branchName
))
{
Write-Host
"
$branchName
is not listed for publishing"
exit
0
}
Publish-Entry
$data
.
branches
.
$branchName
-isBranch
:
$true
}
elseif
(
$releaseName
-ne
""
)
{
if
(
-not
(
Test-Member
$data
.
releases
$releaseName
))
{
elseif
(
$releaseName
-ne
""
)
{
if
(
-not
(
Test-Member
$data
.
releases
$releaseName
))
{
Write-Host
"
$releaseName
is not a valid release"
exit
1
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录