-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Publish Microsoft.Dotnet.Insntallation library to NuGet feed #51575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d38943c
417e0dc
88b2b8e
c17c669
028ec30
a6eae08
3dc1d60
dc1deb5
a2db49c
53baf7c
dcdd02f
5881a86
cabe44a
1c509e5
d6fb259
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,4 +133,4 @@ extends: | |
| pool: | ||
| name: $(DncEngInternalBuildPool) | ||
| image: 1es-windows-2022 | ||
| os: windows | ||
| os: windows | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,8 @@ jobs: | |
| enableSbom: ${{ parameters.enableSbom }} | ||
| variables: | ||
| - ${{ insert }}: ${{ parameters.variables }} | ||
| - name: _officialBuildProperties | ||
| value: /p:OfficialBuilder=Microsoft /p:OfficialBuildId=$(Build.BuildNumber) | ||
| dependsOn: ${{ parameters.dependsOn }} | ||
| preSteps: ${{ parameters.preSteps }} | ||
| templateContext: | ||
|
|
@@ -44,17 +46,30 @@ jobs: | |
| targetPath: '$(Build.SourcesDirectory)/artifacts/packages/Release/NonShipping/' | ||
| artifactName: 'dnup-library-packages' | ||
| publishLocation: Container | ||
| - output: pipelineArtifact | ||
| displayName: '📊 Publish dnup library build binlogs' | ||
| condition: always() | ||
| targetPath: '$(Build.SourcesDirectory)/artifacts/binlogs/' | ||
| artifactName: 'dnup-library-binlogs' | ||
| publishLocation: Container | ||
| steps: | ||
| - ${{ if eq(parameters.pool.os, 'windows') }}: | ||
| - powershell: | | ||
| & .\restore.cmd | ||
| & .\restore.cmd $(_officialBuildProperties) | ||
| displayName: 🍱 Bootstrap toolset (Windows) | ||
| - powershell: | | ||
| & .\.dotnet\dotnet build test\dnup.Tests\dnup.Tests.csproj -c Release | ||
| & .\.dotnet\dotnet build test\dnup.Tests\dnup.Tests.csproj -c Release -bl:$(Build.SourcesDirectory)/artifacts/binlogs/dnup-library-build.binlog $(_officialBuildProperties) | ||
| displayName: 💻 Build Windows | ||
| - powershell: | | ||
| & .\.dotnet\dotnet pack .\src\Installer\Microsoft.Dotnet.Installation\Microsoft.Dotnet.Installation.csproj | ||
| & .\.dotnet\dotnet pack .\src\Installer\Microsoft.Dotnet.Installation\Microsoft.Dotnet.Installation.csproj -bl:$(Build.SourcesDirectory)/artifacts/binlogs/dnup-library-package.binlog $(_officialBuildProperties) | ||
| displayName: 📦 Package dnup library | ||
| - powershell: | | ||
| & .\.dotnet\dotnet build .\src\Installer\Microsoft.Dotnet.Installation\Microsoft.Dotnet.Installation.sign.proj /t:Sign | ||
| & .\.dotnet\dotnet build .\src\Installer\Installer.sign.proj /t:Sign -bl:$(Build.SourcesDirectory)/artifacts/binlogs/dnup-library-sign.binlog $(_officialBuildProperties) | ||
| displayName: 🖋️ Sign dnup library packages with arcade signtool | ||
| - task: 1ES.PublishNuget@1 | ||
| displayName: 🟣 Publish packages to AzDO | ||
| inputs: | ||
| useDotNetTask: true | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something to note here, I don't think this will consume the .dotnet/dotnet, so that may have different behavior from the .NET 10 SDK we've used above. All this is doing is publish so I dont see it causing issues, but it may be confusing if we change publishing somehow in the major version of the SDK, and the rest of the build relies on latest while this relies on whatever the CI machine has (I think right now, it's .net 9.) Anyway I don't see this as a major issue.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's likely a setting to use a custom exe, most 1es tasks do have this. |
||
| packagesToPush: '$(Build.SourcesDirectory)/artifacts/packages/Release/**/*.nupkg;!$(Build.SourcesDirectory)/artifacts/packages/Release/**/*.symbols.nupkg' | ||
| packageParentPath: $(Build.SourcesDirectory)/artifacts/packages/Release | ||
| publishVstsFeed: public/dotnet-tools | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,13 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
| <PropertyGroup> | ||
| <TargetFramework>net10.0</TargetFramework> | ||
| <!-- Determine repository root when the pipeline variables are unavailable (e.g. local invocations). --> | ||
| <_RepoRoot Condition="'$(RepoRoot)' != ''">$(RepoRoot)</_RepoRoot> | ||
| <_RepoRoot Condition="'$(_RepoRoot)' == ''">$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\..\'))</_RepoRoot> | ||
|
|
||
| <!-- Allow callers to override these directories; fall back to repo-relative defaults. --> | ||
| <PackagesDir Condition="'$(PackagesDir)' == ''">$(_RepoRoot)artifacts\packages\Release\</PackagesDir> | ||
| <IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(_RepoRoot)artifacts\obj\Sign\</IntermediateOutputPath> | ||
| <LogDir Condition="'$(LogDir)' == ''">$(_RepoRoot)artifacts\log\Sign\</LogDir> | ||
| <PackagesDir Condition="'$(PackagesDir)' == ''">$(RepoRoot)artifacts\packages\Release\</PackagesDir> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice improvement, thanks. |
||
| <IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(RepoRoot)artifacts\obj\Sign\</IntermediateOutputPath> | ||
| <LogDir Condition="'$(LogDir)' == ''">$(RepoRoot)artifacts\log\Sign\</LogDir> | ||
|
|
||
| <!-- SignTool requires explicit dotnet path; default to repo-local SDK. --> | ||
| <DotNetPath Condition="'$(DotNetPath)' == ''">$(_RepoRoot).dotnet\dotnet.exe</DotNetPath> | ||
| <DotNetPath Condition="'$(DotNetPath)' == ''">$(RepoRoot).dotnet\dotnet.exe</DotNetPath> | ||
|
|
||
| <MicroBuild_DoNotStrongNameSign>true</MicroBuild_DoNotStrongNameSign> | ||
| <MicroBuild_SigningEnabled>true</MicroBuild_SigningEnabled> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,8 +13,8 @@ | |
| <PackageId>Microsoft.Dotnet.Installation</PackageId> | ||
| <IsShipping>false</IsShipping> | ||
| <Title>.NET Installation Library</Title> | ||
| <Version>1.0.0-alpha</Version> | ||
| <PackageVersion Condition="'$(PackageVersion)'==''">$(Version)</PackageVersion> | ||
| <VersionPrefix>0.1.0</VersionPrefix> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What will happen when we try to publish a package with the version that's already been published, since we don't automatically update the build number per each PR? Does it just replace it?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Arcade automatically adds the build number to the prerelease specifier if the package version isn't stabilized. For example, we end up with something like 0.1.0-preview.2.25555.2. |
||
| <PreReleaseVersionLabel>preview</PreReleaseVersionLabel> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: In theory, I would prefer to keep publish as a separate task if we ever want to do a deployment.
In practice, that'd need to be a separate stage which relies on the package yml stage to finish. That means we'll need to wait for another machine to be available which adds delay. So, I'm happy with this in the long term for now too!