Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vsts-dnup-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ extends:
pool:
name: $(DncEngInternalBuildPool)
image: 1es-windows-2022
os: windows
os: windows
6 changes: 0 additions & 6 deletions .vsts-dnup-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ pr:
include:
- dnup
- release/dnup
paths:
include:
- src/Installer/dnup/
- test/dnup.Tests/
- global.json
- .vsts-dnup-tests.yml

parameters:
- name: enableArm64Job
Expand Down
23 changes: 19 additions & 4 deletions eng/pipelines/templates/jobs/dnup/dnup-library-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Copy link
Member

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!

displayName: 🟣 Publish packages to AzDO
inputs:
useDotNetTask: true
Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Member

Choose a reason for hiding this comment

The 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>
Copy link
Member

Choose a reason for hiding this comment

The 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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Member Author

Choose a reason for hiding this comment

The 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>
Expand Down