Skip to content

Commit

Permalink
Replacement method - NuPkg publish to blob feed: SDK (#1726)
Browse files Browse the repository at this point in the history
* Remove prior PublishToTransportFeed method; part 1

* Remove prior PublishToTransportFeed method; part 2

* First draft replacement method to publish nupkgs to blob feed.

* Fixing the restore commands.

* Updating the Transport feed URL.

* Updates per code review...

* More updates per code review...

* Updates related to manual testing...
  • Loading branch information
johnbeisner authored Nov 14, 2017
1 parent fc3e52d commit c8dc2a3
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 91 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml

Expand Down
2 changes: 1 addition & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="TransportFeed" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/packages/index.json" />
<add key="BlobFeed" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="nugetbuild" value="https://www.myget.org/F/nugetbuild/api/v3/index.json" />
<add key="msbuild" value="https://dotnet.myget.org/F/msbuild/api/v3/index.json" />
<add key="dotnet-buildtools" value="https://dotnet.myget.org/F/dotnet-buildtools/api/v3/index.json" />
Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ if ($Verbosity -eq 'diagnostic') {
}

# Install a stage 0
$DOTNET_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1"
$DOTNET_INSTALL_SCRIPT_URL="https://dot.net/v1/dotnet-install.ps1"
Invoke-WebRequest $DOTNET_INSTALL_SCRIPT_URL -OutFile "$env:DOTNET_INSTALL_DIR\dotnet-install.ps1"

& "$env:DOTNET_INSTALL_DIR\dotnet-install.ps1" -Version $DotnetCLIVersion $dotnetInstallVerbosity
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if [ -z "$HOME" ]; then
fi

# Install a stage 0
DOTNET_INSTALL_SCRIPT_URL="https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh"
DOTNET_INSTALL_SCRIPT_URL="https://dot.net/v1/dotnet-install.sh"
curl -sSL "$DOTNET_INSTALL_SCRIPT_URL" | bash /dev/stdin --version $DOTNET_CLI_VERSION --verbose

# Install 1.0.4 shared framework
Expand Down
22 changes: 0 additions & 22 deletions build/Publish/Publish.csproj

This file was deleted.

63 changes: 0 additions & 63 deletions build/Publish/PublishNupkgToTransportFeed.targets

This file was deleted.

12 changes: 9 additions & 3 deletions build/build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

<ItemGroup>
<SolutionFile Include="$(RepositoryRootDirectory)sdk.sln" />
<BuildToolsProjectFile Include="$(RepositoryRootDirectory)tools\BuildTools.proj" />
<SigningProjectFile Include="$(RepositoryRootDirectory)build\Signing\Microsoft.NET.Signing.proj"/>
<NuGetProjectFile Include="$(RepositoryRootDirectory)src\Tasks\Microsoft.NET.Build.Tasks\Microsoft.NET.Build.Tasks.csproj" />
<NuGetProjectFile Include="$(RepositoryRootDirectory)src\Tasks\Microsoft.NET.Build.Extensions.Tasks\Microsoft.NET.Build.Extensions.Tasks.csproj" />
Expand All @@ -36,9 +37,14 @@
</__SetNuget_Packages>
</PropertyGroup>

<Exec Command="$(__SetNuget_Packages)$(__NewLine)$(DotNetTool) restore $(SolutionFile) /v:minimal"
WorkingDirectory="$(RepositoryRootDirectory)"
/>
<ItemGroup>
<Command Include="$(__SetNuget_Packages)$(__NewLine)$(DotNetTool) restore %(SolutionFile.Identity) /v:minimal"
WorkingDirectory="$(RepositoryRootDirectory)" />
<Command Include="$(__SetNuget_Packages)$(__NewLine)$(DotNetTool) restore %(BuildToolsProjectFile.Identity) /v:minimal"
WorkingDirectory="$(RepositoryRootDirectory)" />
</ItemGroup>

<Exec Command="%(Command.Identity)"/>
</Target>

<Target Name="BuildSolution">
Expand Down
19 changes: 19 additions & 0 deletions tools/BuildTools.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'Common.props'))\Common.props" />
<Import Project="$(MSBuildThisFileDirectory)/obj/BuildTools.proj.nuget.g.targets" Condition="Exists('$(MSBuildThisFileDirectory)/obj/BuildTools.proj.nuget.g.targets')" />
<Import Project="$(MSBuildThisFileDirectory)/PushToBlobFeed.targets" />

<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
<GenerateDependencyFile>false</GenerateDependencyFile>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<NonShipping>true</NonShipping>
<NoStdLib>true</NoStdLib>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Feed" Version="1.0.0-prerelease-02203-01" />
</ItemGroup>
</Project>
21 changes: 21 additions & 0 deletions tools/PushToBlobFeed.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ItemsToPushGlobPattern Include="$(OutputPath)Packages\Microsoft.NET.Sdk.*.nupkg" />
<ItemsToPushGlobPattern Include="$(OutputPath)Packages\Microsoft.NET.Build.Extensions.*.nupkg" />
</ItemGroup>

<Target Name="PushToBlobFeed" >
<Error Condition="'$(BlobFeedAccessToken)' == ''" Text="Missing property BlobFeedAccessToken." />

<PropertyGroup>
<ExpectedFeedUrl Condition="'$(ExpectedFeedUrl)' == ''">https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json</ExpectedFeedUrl>
</PropertyGroup>

<Message Text="Publish NuPkgs to blob feed started: $(ExpectedFeedUrl)" Importance="High" />
<PushToBlobFeed AccountKey="$(BlobFeedAccessToken)"
ExpectedFeedUrl="$(ExpectedFeedUrl)"
ItemsToPush="@(ItemsToPushGlobPattern)"
Overwrite="false" />
</Target>
</Project>

0 comments on commit c8dc2a3

Please sign in to comment.